我正在打开带有自定义标头的Webview,但是我想像在点击链接后在Telegram上那样打开一个像Intent这样的Android:
import React, { PureComponent } from 'react';
import { View } from 'flockby-ui-kit';
import { WebView } from 'react-native-webview';
import { get, round } from 'lodash';
import Header from './Header';
import ProgressBar from './ProgressBar';
export default class Browser extends PureComponent {
state = {
progressStatus: 0,
};
render() {
const { progressStatus } = this.state;
const { navigation } = this.props;
const { item } = navigation.state.params;
const { link } = item;
return (
<View f={1} style={{ flex: 1 }}>
<Header item={item} nav={navigation} />
<ProgressBar progressStatus={progressStatus} />
<WebView
ref={webview => (this._webview = webview)}
source={{ uri: link }}
onLoadProgress={({ nativeEvent }) => {
this.setState({
progressStatus: round(get(nativeEvent, 'progress', 0), 2) * 100,
});
}}
/>
</View>
);
}
}
或类似Gmail的内容:
我想要实现的是在新的应用程序窗口中打开WebvView
使用https://github.com/proyecto26/react-native-inappbrowser打开应用程序内浏览器,而无需离开应用程序并切换到浏览器。