webview无法在ios和android中打开google.com-react native?
我正在尝试使用webview在react本机应用程序中打开浏览器 我将以下内容作为一个组成部分:webview无法在ios和android中打开google.com-react native?,android,ios,reactjs,react-native,webview,Android,Ios,Reactjs,React Native,Webview,我正在尝试使用webview在react本机应用程序中打开浏览器 我将以下内容作为一个组成部分: import React from 'react'; import { StyleSheet, View, Text, Platform, ScrollView, WebView } from 'react-native'; export default class Browser extends React.Component { render() { var
import React from 'react';
import {
StyleSheet,
View,
Text,
Platform,
ScrollView,
WebView
} from 'react-native';
export default class Browser extends React.Component {
render() {
var DEFAULT_URL = 'https://github.com/facebook/react-native';
return (
<View style={{flex:1}}>
<WebView
automaticallyAdjustContentInsets={false}
source={{uri: DEFAULT_URL}}
javaScriptEnabled={true}
domStorageEnabled={true}
decelerationRate="normal"
startInLoadingState={true}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'space-between',
},
});
我可以用Linking.openURL在safari中打开它,但是如果可以在应用程序本身的浏览器中打开一些东西,那就太好了
你知道为什么会发生这种情况或者如何解决吗?提前感谢您的帮助。您的代码在我这里运行良好。没有得到错误。谷歌打开时没有任何错误。看看这个问题:我认为在你的风格中,你还必须删除
alignItems:“center”
NSURLErrorDomain
Error Code: -1202
Description: The certificate for this server is invalid. You might be connecting to a server that is pretending to be "www.google.com" which could put your confidential information at risk