react-native-htmlview使用

作者: 荞叶 | 来源:发表于2016-08-17 20:47 被阅读510次
  • 字体加粗
    react-native-htmlview解析html <b>需要前后都留空,才能正确解析
  • 字体样式
    HTMLView需要包褒在Text里面,才能让应用的font style生效
    Paste_Image.png
class Demo extends Component{    
    render(){       
         var htmlContent='拒绝 <b>百度</b> <br>从我做起';    
        return(            
            <View style={styles.container}>                
                <Text style={styles.text}>
                    <HTMLView  value={htmlContent}/>
                </Text>                

              <HTMLView value={htmlContent} style={styles.text} />
          <View>
        ); 
    }
}

相关文章

网友评论

  • koala_:希望写出更有质量的文章:smiley:

本文标题:react-native-htmlview使用

本文链接:https://www.haomeiwen.com/subject/gjamsttx.html