尝试调整WebView的大小,
import{Dimensions, SafeAreaView, WebView} from 'react-native';
<SafeAreaView style={{flex:1}}>
<WebView
originWhitelist={['*']}
onLoad={this.onLoad}
source={Platform.OS === 'android' ? { uri: 'file:///android_asset/index.html' } : require('../ios/web/index.html')}
dataDetectorTypes={'none'}
ref='webview'
onMessage={e => this.onMessage(JSON.parse(e.nativeEvent.data))}
onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequest}
onNavigationStateChange={this.onShouldStartLoadWithRequest}
injectedJavaScript={patchPostMessageJsCode}
useWebKit={true}
style={{ height: Dimensions.get('window').width.height, width:Dimensions.get('window') , resizeMode: 'cover', flex: 1 }}
/>
</SafeAreaView>