【发布时间】:2020-11-07 14:45:30
【问题描述】:
我正在使用 WebView 在我的 react-native 应用程序中显示 twitch-stream 的 iframe,但是在某些时候它呈现 WebView 仅显示为空白屏幕,直到您滚动/移动 UI 和在其他时候,它按预期工作。 WebView 为空白时不会发出任何错误,它似乎按预期加载,所以不确定为什么它只显示空白屏幕。
这里是 WebView 代码:
<Animated.View
style={{
height: anim,
width: width,
overflow: 'hidden',
}}
>
<WebView
onLoadEnd={() => {
useAnimation()
}}
source={{
uri: `https://host.com/iframe/?channel=${channelName}`,
}}
style={{
height: heightByRatio,
width: width,
flex: 0,
}}
mediaPlaybackRequiresUserAction={false}
allowsInlineMediaPlayback={true}
/>
</Animated.View>
【问题讨论】:
标签: react-native webview