I tried to show content using webview but screen shows me white screen before webpage load complete .
I want to change color white to #131416. but style option doesn’t work.
how can I fix this?
<WebView
ref={webViewRef}
source={{
uri: currentUrl.current,
}}
style={{ flex: 1, backgroundColor: "#131416" }}
onLoadStart={handleOnLoadStart}
javaScriptEnabled={true}
allowFileAccess={true}
onMessage={handleMessage}
onNavigationStateChange={setNavigationState}
userAgent={userAgent}
onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
scrollEnabled={true}
domStorageEnabled={true}
startInLoadingState={true}
onLoadEnd={handleOnLoadEnd}
onContentProcessDidTerminate={() => {
RNRestart.restart();
}}
/>
I tried change styles and used renderLoading props but doesn’t work.
2
Answers
Wrap
WebView
(transparent background) withView
and define the desired background color there.