react-native动画的坑
准备做一个循环上下滚动的react-native动画,但是遇到了坑.我在调试的过程中把Animated.Image改成了Image,然后忘了改过来: componentDidMount() { this.spinAniamte(); } render(){ return ( <View style={{flex:1,justifyContent:'center'}}> <Image capInsets={{top:20,right:20,left:20,bottom:20}} source={{uri:'scan_border'}} style={{alignItems:'center',position:"absolute",left:carmaLeft,right:carmaLeft,height:carmaHeight}} resizeMode={'stretch'}> <Image source={{uri:'scanLine'}} style={{position:"absolute",top:this.spinValueOne,height:7,width:200}}></Animated.Image> </Image> </View> ); } 结果到Animated.timing方法里面去访问 this.spinValueOne会一直报错: 如果Animated.timing,没有对应的Animated组件就会报这种错! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |