【问题标题】:React Native BackgroundImage doesn't show required GIFs - iOSReact Native BackgroundImage 不显示所需的 GIF - iOS
【发布时间】:2018-12-09 10:48:34
【问题描述】:

是否可以在带有 React-Native 的 iOS 上使用 -source={require(...)} 显示动画 GIF?

以下示例不起作用:

<ImageBackground source={require(...)} style={{width:'100%',height:'100%'}} />

这个例子有效:

<Image source={{uri: 'https://media.giphy.com/media/JQ3IMbDi5Jkw8/giphy.gif'}} style={{width:'100%',height:'100%'}} />

我将使用 ImageBackground 和 "require" 在 IOS 上显示动画 GIF。 一切都在 Android 上运行。

我希望有人可以帮助我。

【问题讨论】:

    标签: ios react-native gif react-native-ios imagebackground


    【解决方案1】:

    当然,它也适用于 IOS。你可以使用https://snack.expo.io进行测试

    Here 正在使用 IOS 中的 ImageBackground 组件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-15
      • 2016-06-06
      • 1970-01-01
      • 2020-02-09
      • 2018-02-03
      • 2015-12-03
      • 2016-01-17
      相关资源
      最近更新 更多