ReactNative学习-webView

时间:2023-03-09 08:44:58
ReactNative学习-webView

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

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}
/>
)
}
}