問題
正常的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 ,
}
結果