【发布时间】:2018-12-19 06:23:38
【问题描述】:
我正在使用 api 来响应此代码
<p> <iframe width="1165" height="655" src="https://www.youtube.com/embed/sJUCMmYsN1A?feature=oembed" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>
我正在使用 WebView 在 React Native App 中显示此内容,但 iframe 视频高度宽度太长。
有什么建议吗??
<View style={{width: width, flexDirection: 'column', alignItems: 'center', justifyContent: 'center'}} >
<Text style={{fontSize: 18}}>Description here</Text>
{/* <HTML
html={product.description}
imagesMaxWidth={Dimensions.get('window').width}
staticContentMaxWidth={200}
/> */}
<WebView
source={{html: product.description}}
bounces={false} // IOS Only
dataDetectorTypes='link'
scalesPageToFit={true}
scrollEnabled={false}
automaticallyAdjustContentInsets={false}
mediaPlaybackRequiresUserAction={true}
style={{marginRight: 10, marginLeft: 10, marginRight:10, width: width, height: 1000}}
/>
</View>
【问题讨论】:
标签: html react-native webview