【问题标题】:React Native - ImageBackground not showing Image on TvOSReact Native - ImageBackground 未在 TvOS 上显示图像
【发布时间】:2021-02-05 15:31:41
【问题描述】:

我正在尝试在我的 tvOS 应用程序上获取图像。但它没有显示出来。

我的URLhttps,我在Android TV 中使用了相同的代码,它就像一个魅力,当我console.log url 时,它也是完美的。

遵循以下行为:

“粉红色”图像是fast-image。好的,它工作得很好,但是“红色背景”是ImageBackground 并且没有加载图像。两者都使用相同的图像存储库。

按照下面的代码:

<ImageBackground
          source={{
            uri: getEnvProperties().BASEURL_IMAGES + banner?.imageBanner,
          }}
          onError={this.handleError}
          style={{ height: getScaledValue(350), width, backgroundColor: 'red' }}>
          <LinearGradient
            start={{ x: 1, y: 0 }}
            end={{ x: 0, y: 0 }}
            colors={['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 0.5)']}
            style={styles.linearGradient}>
              //other codes....
          </LinearGradient>
 </ImageBackground>

onError 事件没有捕获任何错误。

谁知道我能做些什么来解决这个问题?

非常感谢。

【问题讨论】:

标签: react-native tvos imagebackground


【解决方案1】:

在新版TvOS包中已解决如下:GitHub TvOS Changelog

【讨论】:

    猜你喜欢
    • 2021-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多