Я сделал приложение для веб-просмотра с реагировать на родной язык, чтобы отобразить веб-сайт Facebook, но была проблема, когда я хотел загрузить фотографию, нажав кнопку загрузки фото в разделе статуса всплывающего окна, ответа не было ... какое было решение?
import React, { Component } from 'react';
import { Button, View, WebView, StyleSheet, TouchableOpacity, Text, Image } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.reload = this.reload.bind(this);
}
reload() {
this.webview.reload();
}
render() {
return (
<View style={{ flex: 1 }}>
<View style={{ height: 20 }} />
<WebView
ref={ref => (this.webview = ref)}
source={{ uri: 'https://facebo.com' }}
onError={console.error.bind(console, 'error')}
bounces={false}
onShouldStartLoadWithRequest={() => true}
javaScriptEnabledAndroid={true}
startInLoadingState={true}
style={{ flex: 1 }}
/>
<View style={{alignItems:'center'}}>
<TouchableOpacity onPress={this.reload}>
<Image source={require('../assets/reload.png')} style={styles.fab} />
</TouchableOpacity>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
fab: {
width: 40,
height: 40,
justifyContent: 'center',
},
});