我正在使用sample.json圖像文件,它是我的頁面中的bodymovin動畫,通過Lottie for React Native。bodymovin動畫在原生反應上出錯?
我得到圖像,但未完全檢索圖像,圖像的某些部分丟失,並且在圖像的某一側,圖像上粘貼了綠色。
但我通過在線json圖像查看器檢查了sample.json。但與從源頭
圖像沒有問題,這裏是問題https://i.stack.imgur.com/yFZfg.jpg
這裏是原始圖像https://i.stack.imgur.com/4sBzg.jpg
所以這裏是我的代碼
import React from 'react';
import { Animated, Easing, easing } from 'react-native';
import Animation from 'lottie-react-native';
export default class BasicExample extends React.Component {
constructor(props) {
super(props);
this.state = {
progress: new Animated.Value(0.5),
};
}
componentDidMount() {
this.startAnimation();
}
startAnimation() {
Animated.timing(
this.state.progress,
{
toValue: 1,
from: 0,
to: 1,
duration: 5000,
}
)
.start(() => {
// Restart at end
this.state.progress.setValue(0);
this.startAnimation();
});
}
render() {
const easing = Easing.inOut(Easing.quad);
const { Animate } = this.props;
return (
<Animation
style={{
width: 300,
height: 300,
}}
source={this.props.Animate}
progress={this.state.progress}
/>
);
}
}
我安裝洛蒂NPM也。
所以這是我的問題,請幫助我克服這個提前感謝
耶同樣的問題,我面對。這個動畫即將在iPhone中...在android甚至圖像不會來...當在Android中運行應用程序正在被殺死和關閉...我通過世博會 – Vijay
使用CRNA爲什麼因爲動畫已經在json中完成正確...所以我們不需要努力動畫..不是嗎? @zvona – Vijay
好吧現在就試試吧 – Vijay