问题
正常的WebView代码:
<WebView style={styles.webView}
automaticallyAdjustContentInsets={true}
onLoadEnd={this._webLoadOver}
onError={this._webLoadOver}
source={{uri:"" }}>
</WebView>
webView:{
width: width * 0.98,
marginTop:8,
backgroundColor:'white',
marginBottom:isIphoneX ? 39 :5 ,
}
但是结果不正常,莫名出现了黑线

解决方案
给WebView一个透明的背景色即可解决问题:
webView:{
width: width * 0.98,
marginTop:8,
backgroundColor:'rgba(255, 255, 255, 0.0)',
marginBottom:isIphoneX ? 39 :5 ,
}

网友评论