React-native-webview: BackgroundColor in loadingState is always white

Created on 25 Apr 2019  路  2Comments  路  Source: react-native-webview/react-native-webview

The backgroundColor does not set the backgroundColor of the loadingView.
This color is hardcoded to white. It works only when i set useWebKit={false}. Which leads to a white flash when the WebView is initializing.

To Reproduce:
style={{ backgroundColor: '#000000' }}
ref={(ref) => this.webview = ref}
source={{ html }}
scrollEnabled={false}
mediaPlaybackRequiresUserAction={false}
allowsInlineMediaPlayback={true}
onShouldStartLoadWithRequest={this.onWebviewRedirect}
/>
Expected behavior:

The background should be the color defined via backgroundColor when the Webview is initializing.

Environment:

  • OS: iOS
  • OS version: 11.4
  • react-native version: 0.59.3
  • react-native-webview version: 5.7.0
bug report

Most helpful comment

@Titozzz ah i see, yes this does the trick (loading view is now green):
startInLoadingState={true}
renderLoading={() => }

All 2 comments

Can you adjust the loading behavior with the renderLoading prop ?

@Titozzz ah i see, yes this does the trick (loading view is now green):
startInLoadingState={true}
renderLoading={() => }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ranshine picture ranshine  路  3Comments

emeraldsanto picture emeraldsanto  路  3Comments

BruceSuperProgramer picture BruceSuperProgramer  路  3Comments

codesinghanoop picture codesinghanoop  路  3Comments

rezvalari picture rezvalari  路  3Comments