私はWebViewコンポーネントをテストしていますが、レンダリングすることはできません。ここReact Native:Webviewの使い方は?
サンプル:https://snack.expo.io/r1oje4C3-
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.paragraph}>
Change code in the editor and watch it change on your phone!
Save to get a shareable url. You get a new url each time you save.
</Text>
<WebView source={{html: '<p>Here I am</p>'}} />
<WebView source={{ uri: 'http://www.google.com'}} />
</View>
);
}
}
万博で上記の例を実行し、2つのWebViewコンポーネントのどちらをレンダリングするように見えます。私は間違って何をしていますか?あなたにも、高さ、スタイルパラメータを提供する必要があります
<WebView
source={{uri: 'https://github.com/facebook/react-native'}}
style={{width: 300}}
/>
注:
に
flex: 1
でstyle
小道具を追加します。 –これは変です。私は答えを更新します – Nepho