我正在使用Lottie制作动画。问题是很多视图尺寸太小。有没有办法在lottie中自定义尺寸?
如您所知,我们可以通过“Adobe After Effect”制作乐透动画,但我想知道如何通过“Photoshop”来制作?有什么方法可以将 GIF 转换为 Lottie JSON 吗?
我在我的 Android 应用程序中使用随机 Lottie 动画。我需要知道 Lottie 动画中使用的总帧数。根据总帧数,我想将动画从第一帧循环到特定帧。例如。如果 Lottie 文件包含 60 帧,那么我想执行从 1 到 < 60 的任何数字的动画。
我正在使用以下依赖项
implementation 'com.airbnb.android:lottie:3.4.2'
Run Code Online (Sandbox Code Playgroud) 我有一个反应本机应用程序,当从 XCode 运行时,它按预期工作(在模拟器上构建和运行)。但是当我尝试从我的终端运行它时
\nnpx react-native run-ios\nRun Code Online (Sandbox Code Playgroud)\n我收到错误:
\nerror Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening foo.xcworkspace.\nCommand line invocation:\n /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace foo.xcworkspace -configuration Debug -scheme foo -destination id=FEB37\n\nUser defaults from command line:\n IDEPackageSupportUseBuiltinSCM = YES\n\nxcodebuild: error: The workspace named "foo" does not contain a scheme named "foo". The "-list" option can be used to find the …Run Code Online (Sandbox Code Playgroud) 我使用来自lottie的线性渐变,代码在ios上运行良好,但在android中它不适合全屏,渐变和视图之间有某种填充。在ios上它工作正常...我尝试了很多方法,包括购买padding到0甚至保证金到-20,但没有任何效果...有什么解决方案吗?

import React, { Component } from 'react';
import {
Text,
StyleSheet,
View,
Platform,
Dimensions
} from 'react-native';
import SignInScreen from './src/screens/auth/SignInScreen';
import Animation from 'lottie-react-native';
import anim from './assets/gradient_animated_background.json';
const height = Dimensions.get('window').height + 20;
const width = Dimensions.get('window').width + 20;
export default class App extends Component {
componentDidMount() {
this.animation.play();
}
render() {
return (
<View style={styles.container}>
<Animation
ref={animation => {
this.animation = animation;
}}
style={{
backgroundColor: 'red',
height: '100%',
width: '100%'
}}
loop={true}
source={Platform.OS === …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Xcode 11.2 制作一个简单的游戏,其中包含一个动画循环背景和一个视图,该视图显示和更改项目中多个 Lottie JSON 文件的各种动画。
当我单击“下一步”按钮更改视图动画时,循环的背景视图会卡住一秒钟,直到加载视图内的下一个动画,应用程序中的所有内容都会像背景动画一样同时冻结。
CPU 使用率从 30% 到 63% 不等。
我不想让问题复杂化,所以我只是展示我使用 Lottie 的方式。
@IBAction func SubmitButtonAction(_ sender: UIButton) {
showNextQuestion()
}
func showNextQuestion()->(){
myTimer.invalidate()
startCountdown(fromTime: 15)
Manager.generateQuestion()
lblLevel.text = String(Manager.questionNumber) + "/" + String(DataModel.Questions.count)
nIndex = 0
let animation = AnimationView(name: Manager.currentImage)
animation.loopMode = .loop
animation.play()
animation.backgroundColor = UIColor.clear
animation.frame = self.AnimView.bounds
animation.backgroundBehavior = .pauseAndRestore
if AnimView.subviews.isEmpty{
self.AnimView.addSubview(animation)
}
else {
for one in imgImageView.subviews{
one.removeFromSuperview()
}
self.AnimView.addSubview(animation)
}
AnswerCollectionView.reloadData()
RandomCollectionView.reloadData()
}
Run Code Online (Sandbox Code Playgroud)
我对有关该问题与什么相关的建议感兴趣 - 它是否与线程问题有关?
我想在我的 React 应用程序中实现延迟加载,但大多数文件都是 JSON。当视口宽度小于例如 768px 时,它们中的一些正在加载,并且我不想在不需要它们时将它们加载到桌面应用程序中。有没有办法用 React.lazy() 加载 JSON 文件?
我的 JSON 文件是使用 Adobe After Effect 扩展生成的,名为:“Bodymovin”,后来我像这样导入这个文件:
import * as background from './background.json';
import * as backgroundLarge from './background-large.json';
import * as backgroundMedium from './background-medium.json';
import * as backgroundMobile from './background-mobile.json';
import * as backgroundSmallMobile from './background-smallMobile.json';
import * as tree from './tree.json';
import * as treeLarge from './tree-large.json';
import * as treeMedium from './tree-medium.json';
import * as treeMobile from './tree-mobile.json';
import * as treeSmallMobile from './tree-smallMobile.json';
Run Code Online (Sandbox Code Playgroud)
我试图像使用默认导出的任何其他组件一样正常加载它,但它不起作用。
const treeMedium …Run Code Online (Sandbox Code Playgroud) 我必须在 Android 中使用 Lottie 动画作为闪屏。我使用了匹配父级的宽度和高度。但它向我展示了屏幕边缘的一些填充,如附图所示。如果我使用scaletype作为fitXY,那么它的图像会在某些设备上拉伸。我如何为所有设备分辨率使用lottie动画文件,或者我是否需要要求我们的设计师更改文件?
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/retention_bg_welcome_color">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:lottie_autoPlay="true"
app:lottie_fileName="test_lottie.json"
android:adjustViewBounds="true"
app:lottie_loop="true"
app:lottie_speed="0.8" />
</androidx.constraintlayout.widget.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)
我需要制作一个10-15分钟的配音动画。据我所知,lottie 和 rive 的动画不支持音频。将音轨与动画并行运行是一个好的解决方案吗?有人担心可能会出现不同步。有人解决过类似的问题吗?
我正在迁移到 Android 12,API 引入了系统启动屏幕。我想在启动屏幕中显示 Lottie 动画,如何使用 google 推荐的启动屏幕 API 来实现此目的?
lottie ×10
android ×4
json ×2
xcode ×2
android-12 ×1
animation ×1
converters ×1
flutter ×1
gif ×1
kotlin ×1
lazy-loading ×1
photoshop ×1
react-native ×1
reactjs ×1
rive ×1
swift ×1
swift3 ×1