我需要在我的 react-native 应用程序中打开网站。需要同时适用于 iOS 和 Android
最佳答案
您可以使用 WebView
组件:https://facebook.github.io/react-native/docs/webview.html .
像这样:
import React, { Component } from 'react';
import { WebView } from 'react-native';
class MyWebViewComponent extends Component {
render() {
return (
<WebView
source={{uri: 'https://google.com'}}
style={{marginTop: 10}}
/>
);
}
}
关于android - 如何在react-native应用程序中打开网站(Android和iOS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58534466/