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

后端 未结 14 1931
悲哀的现实
悲哀的现实 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条回答
  •  猫巷女王i
    2020-12-14 06:24

    I had this issue. WebView would render when it was the only component returned, but not when nested in another View component.

    For reasons I'm not entirely sure of the issue was resolved by setting a width property on the WebView component.

    class App extends React.Component {
      render() {
    
        return (
          
            
            
          
        );
      }
    }
    
    const styles = StyleSheet.create({
      container: {
        flex: 1,
        alignItems: 'center',
        justifyContent: 'space-between',
    
      },
      video: {
        marginTop: 20,
        maxHeight: 200,
        width: 320,
        flex: 1
      }
    });
    

提交回复
热议问题