【问题标题】:Lottie Animation - Colors not showing on react native appLottie Animation - 反应本机应用程序上未显示颜色
【发布时间】:2021-09-17 07:52:18
【问题描述】:

我在我的 react native 应用中添加了一个 Lottie 加载动画,该动画目前正在运行,但不知何故没有显示颜色,而只是一个白色动画。

这里是代码。

<View style={styles.lottieLoadingWrapper}>
  <LottieView
    style={styles.lottieLoading}
    source={require('../assets/loading-2.json')}
    autoPlay
    loop
  />
</View>

我没有在样式表中做任何事情。我尝试了多个动画,但都是简单的白色。 我在这里做的错误可能是什么?

更新:以下是样式代码

lottieLoadingWrapper: {
  width: 50,
  height: 50,
  justifyContent: 'center',
  alignItems: 'center',
  backgroundColor: 'yellow',
  alignSelf: 'center',
},
lottieLoading:{
  width: 50,
  height: 50,
  backgroundColor: 'rgba(120, 120, 120, 0.66)',
  justifyContent: 'center',
  alignItems: 'center',
}

以下是我正在使用的动画

Lottie Animation Link

【问题讨论】:

  • 请展示您的风格并分享您的彩票文件
  • 当然,请检查我是否更新了相关问题。
  • @ZaidQureshi 请检查

标签: react-native lottie


【解决方案1】:
<View style={styles.lottieLoadingWrapper}>
  <LottieView
    style={styles.lottieLoading}
    source={require('../assets/loading-2.json')}
    autoPlay
    loop
  />
</View> 


Please Change the Color in JSON file, Find "sc":"#ffffff" and 
Replace with your color

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-28
    • 2021-03-15
    • 1970-01-01
    • 1970-01-01
    • 2021-09-06
    • 1970-01-01
    相关资源
    最近更新 更多