2

我正在尝试在模态视图中呈现 HTML 字符串。

<Modal animationType="fade" transparent={true} visible={this.state.modalVisible} onRequestClose={() => {}}>
  {this.safeZoneHeader()}
  <View style={{flex:1 ,backgroundColor: 'rgba(0,0,0,0.6)',alignItems:'center'}}>

  <View style={{height:'86.4%',width:'94%',marginTop:'3%',alignSelf:'center',marginLeft:'1.3%',marginRight:'1.3%', backgroundColor: '#fff',borderRadius: 20 ,elevation:5,justifyContent: 'flex-start',marginBottom:'3%'}}>
    <ScrollView>
      <View style={{flex:1,marginTop:24,backgroundColor:'#fff',alignSelf:'center',marginLeft:24,marginRight:24}}>

      </View>
      <View style={{flex:1,marginTop:10,backgroundColor:'#fff',alignSelf:'center',marginLeft:24,marginRight:24}}>                          
        <WebView
            originWhitelist={['*']}
            source={{html:this.state.postItemData.Description}}
        />
        </View>
    </ScrollView>
  </View>
  <TouchableOpacity style={{height:48,width:'94%',alignItems:'center',justifyContent:'center',backgroundColor: 'rgba(255,255,255,0.2)',marginBottom:3}} 
                    onPress={()=>this.CloseModalandContinue()} >
    <Text style={{fontSize:14,fontFamily:Fonts.RobotoMedium,color:'#fff'}}>
      {this.props.labels.labelList.LanguageList.closeModalToViewPosts}
    </Text>

  </TouchableOpacity>

 </View>
 {this.safeZoneFooter()}
</Modal>

但它没有显示在模态中。有谁知道这个的解决方案?谢谢你。react-native-webView - 5.12.0 react-native - 0.57.8

4

0 回答 0