我有一个没有被渲染的web视图组件。webview来自react-native-webview。这是我的webview组件:
<View style={{ flex: 1 }}>
<Text>hello</Text>
          <WebView 
              source={{
                  uri: 'https://www.google.com'
              }}
              style={{ flex: 1 }}
          />
<Text>hello</Text>
      </View>这两个hello都被渲染了,但是webview没有,还有webview组件被渲染的地方,其他组件也在那里,但是有display:none。感谢任何帮助!
发布于 2020-05-03 16:41:07
我试过你的代码,它工作得很好:
检查以下内容:
import React from 'react'
import { View, Text} from 'react-native'
import {WebView} from 'react-native-webview';
class App extends React.Component {
render(){
    return (
        <View style={{ flex: 1 }}>
        <Text>hello</Text>
                  <WebView 
                      source={{
                          uri: 'https://www.google.com'
                      }}
                      style={{ flex: 1 }}
                  />
        <Text>hello</Text>
              </View>
            );
}
};
export default App;

希望这能有所帮助!
https://stackoverflow.com/questions/61571228
复制相似问题