ActivityIndi​​cator不会在Android上旋转或仅对静态图像进行动画处理

Wat*_*lva 2 android activity-indicator react-native

活动指示器可以在IOS上正常工作,但不能在android上旋转或设置动画,任何帮助???

<View style{{marginLeft:0,width:60,height:60,borderRadius: 30,justifyContent:"center",alignItems:"center", backgroundColor:'#eee', borderColor:"#fff", borderWidth:1 }}>
    <ActivityIndicator size="small" animating={true}/>
</View>
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

小智 5

我也遇到了这个问题,原因是我在开发人员选项中禁用了动画(缩放为x0)。如果您更改此配置(动画比例)或禁用开发人员选项,则应该可以解决您的问题。希望能帮助到你

  • 这个评论非常有帮助。我尝试了很多不同的解决方案。直到我在开发者选项中打开动画后,它们才起作用! (2认同)

Sar*_*hah -1

我在我的反应本机项目中实现了相同的代码......为我工作

<View style={{ marginLeft:0, width:60,height:60,borderRadius: 30,justifyContent:"center",alignItems:"center", backgroundColor:'#eee', borderColor:"#fff", borderWidth:1 }}>
    <ActivityIndicator size="small" animating />
  </View>
Run Code Online (Sandbox Code Playgroud)

顺便说一句,您忘记了=样式后的符号(第一行),我的猜测是这个问题不是由于这个视图造成的,可能是某个父组件造成的。