React Native:GIF 不是动画
React Native: GIF is not animated
这是我的模态组件:
export default function LoadingModal(props) {
const {visible} = props;
return (
<Modal transparent visible={visible}>
<View style={styles.modalView}>
<Image
style={styles.loadingGif}
source={require('../../asset/images/loading.gif')}
/>
</View>
</Modal>
);
}
一切正常,除了 GIF 没有动画。
我遵循 React native components 的 RN 0.65 并添加
// For animated GIF support
implementation 'com.facebook.fresco:fresco:2.0.0'
implementation 'com.facebook.fresco:animated-gif:2.0.0'
进入 android/app/build.gradle 在 dependencies
部分,但仍然无法正常工作,
cd android
./gradlew clean
cd ..
react-native run-android ( yarn android )
也不行。
我不知道。所以我希望任何人都可以帮助我解决这个问题。
非常感谢。
我修好了
只需使用implementation 'com.facebook.fresco:animated-gif:2.5.0'
这是我的模态组件:
export default function LoadingModal(props) {
const {visible} = props;
return (
<Modal transparent visible={visible}>
<View style={styles.modalView}>
<Image
style={styles.loadingGif}
source={require('../../asset/images/loading.gif')}
/>
</View>
</Modal>
);
}
一切正常,除了 GIF 没有动画。
我遵循 React native components 的 RN 0.65 并添加
// For animated GIF support
implementation 'com.facebook.fresco:fresco:2.0.0'
implementation 'com.facebook.fresco:animated-gif:2.0.0'
进入 android/app/build.gradle 在 dependencies
部分,但仍然无法正常工作,
cd android
./gradlew clean
cd ..
react-native run-android ( yarn android )
也不行。
我不知道。所以我希望任何人都可以帮助我解决这个问题。 非常感谢。
我修好了
只需使用implementation 'com.facebook.fresco:animated-gif:2.5.0'