cemthecebi
cemthecebi

Reputation: 114

React native white blank screen when load website in a webview

Bug description: The site that I directed with Webview is opened in the ios simulator, Although not working in the andorid simulator.

To Reproduce:
react-native init AwesomeProject cd AwesomeProject react-native run-android

&& my code

code

Expected behavior:. Work same as ios simulator

Screenshots/Videos: Screen Shot 2020-06-01 at 01 21 55 Screen Shot 2020-06-01 at 01 22 16

Environment: - OS: macOS - OS version: 10.15.3 - react-native version: 0.62.2 - react-native-webview version: 10.2.3

Upvotes: 1

Views: 2130

Answers (2)

cemthecebi
cemthecebi

Reputation: 114

there are several solutions that I found for myself. @mlammert

add this code snippet to

\node_modules\react-native webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.java

After that in AndroidManifest.xml add these code snippets.

<uses-permission android:name="android.permission.INTERNET" />

and in the add this one android:usesCleartextTraffic="true">

Upvotes: 0

Duma Cristian
Duma Cristian

Reputation: 587

It could be a styles problem, try the following

<View style={{width: '100%', height: '100%', backgroundColor: '#FFF'}}>
  ...//webview component
</View>

Upvotes: 1

Related Questions