我遇到了一个问题。我正在使用lottie的一个react原生应用程序,但动画不工作,只有我可以看到图像,但没有动画。有人可以帮助我吗?
资源:https://github.com/lottie-react-native/lottie-react-native代码
<>
<Formik
initialValues={{player: ''}}
validationSchema={Yup.object({
player: Yup.string()
.min(3, 'Musth be more 3 letters')
.max(15, 'must be less than 15 letters')
.required('Sorry, this field is required'),
})}
onSubmit={(values, {resetForm}) => {
}}>
{({
handleChange,
handleBlur,
handleSubmit,
values,
touched,
errors,
}) => (
<>
.....
</>
)}
</Formik>
<Modal animationType="slide" transparent={false} visible={visible}>
<View
style={{
height: '100%',
width: '100%',
backgroundColor: 'rgba(255,255,255,0.1)',
alignContent: 'center',
alignItems: 'center',
justifyContent: 'center',
}}>
<LottieView
source={require('../assets/loading.json')}
style={{
width: 200,
height: 200,
alignSelf: 'center',
}}
autoPlay
loop
/>
</View>
</Modal>
</>
1条答案
按热度按时间oxcyiej71#
常数索引:React本币=()=〉{常量批次视图参照=使用参照(空)
}