Skip to content

how to use this? i can't understand #22

Open
@haofeng123

Description

@haofeng123

import UserAgent from 'react-native-user-agent';

UserAgent.getUserAgent();

render() {
   var url = 'http://qun.hk/';
    return (
        <ScrollView
            automaticallyAdjustContentInsets={false}
            contentOffset={{top:20}}
            bounces={false}
            style={styles.container}>                             

            <StatusBar barStyle='light-content' backgroundColor='rgba(40,116,203,1)' translucent={true}></StatusBar>
            <WebView
                   nativeConfig={
                        {
                            props: {
                                backgroundColor: '#ffffff',
                                flex: 1,
                            }
                        }
                  }
                  ref={WEBVIEW_REF}
                  style={styles.webView}  
                  source={{uri:url,method: 'GET'}}  
                  javaScriptEnabled={true}  
                  domStorageEnabled={true}  
                  scalesPageToFit={false} 
                  mixedContentMode={'always'}
                  userAgent="Cordova-User-Agent"
                  // onMessage={(event) => {console.warn(event.nativeEvent.data);}}
                  onMessage={this.onMessage}
                  onNavigationStateChange={(e)=>this.onNavigationStateChange(e)}
                  />
        </ScrollView>
    );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions