React Native Webview not loading any url (React native web view not working)

后端 未结 14 1933
悲哀的现实
悲哀的现实 2020-12-14 05:41

I am trying to implement react native webview component in my application, but the web view is not loading any url its just showing the white page.

var React         


        
14条回答
  •  孤城傲影
    2020-12-14 06:15

    
        
    
    

    and style as follows:

    const React = require('react-native');
    
    const { Dimensions } = React;
    
    const deviceHeight = Dimensions.get('window').height;
    const deviceWidth = Dimensions.get('window').width;
    
    export default {
      webview: {
          width: deviceWidth,
          height: deviceHeight
      }
    };
    

    All this to deal with bad webview dimension, so just set a specific height and specific width too (deviceHeight and deviceWidth as the example above).

提交回复
热议问题