ReactNative学习-webView

桑睿识
2023-12-01

在软件内部打开一个网页--不喜欢它没有办法返回,还需要再添加返回按钮==

import React from 'react';
import {
    AppRegistry,
    Component,
    ScrollView,
    TouchableOpacity,
    Text,
    View,
    WebView
} from 'react-native';

export default class WebViewView extends React.Component {
    render() {
        var url = this.props.stateParams;
        return (
            <WebView
                ref="webview"
                automaticallyAdjustContentInsets={false}
                style={{backgroundColor:'rgba(255,255,255,0.8)', height:350}}
                source={{uri:url}}
                javaScriptEnabled={true}
                domStorageEnabled={true}
                decelerationRate="normal"
                startInLoadingState={true}
            />
        )
    }
}

 

转载于:https://www.cnblogs.com/maoyazhi/p/5644622.html

 类似资料: