Solution 1 :

Maybe this injectable code block help to you.

injectedJavaScript={`const meta = document.createElement('meta'); 
meta.setAttribute('content', 'width=device-width, initial-scale=0.5, maximum- 
scale=0.5, user-scalable=0'); meta.setAttribute('name', 'viewport'); 
document.getElementsByTagName('head')[0].appendChild(meta); `}
scalesPageToFit={false}

Problem :

I am loading a web page in react-native-webview in my react native application. In iOS, everything works fine and I am able to scroll down the web page. But the problem is happening in Android. It is not allowing to scroll the web page. Here was my code

<WebView 
       style={{ 
                height:1000,        
                flex: 1,
                fontFamily:'TitilliumWeb-SemiBold',
                   color:'#38c654',
                    fontSize:15,
                    width:'100%',
                    marginTop:5,
                    backgroundColor:'transparent',
              }}
                    
                    
             originWhitelist={['*']}
             scalesPageToFit={true}
             javaScriptEnabled={true}
             domStorageEnabled={true}
             startInLoadingState={true}
             renderLoading={() => {
                 return this.displaySpinner();
             }}
                  
             source={{
                     uri: URLLink
                    }}
             /> 

After that I googled and found one more library react-native-autoheight-webview. And I used that as well but still I am unable to scroll the web page in Android. Any solution for this will be a great help.

By

Leave a Reply

Your email address will not be published. Required fields are marked *