【问题标题】:React native render HTMl -> classstyle not working反应原生渲染 HTML -> 类样式不起作用
【发布时间】:2020-11-18 16:47:35
【问题描述】:

您好,我正在使用 react-native-render-html 渲染 HTML。

    var strHTML = ''
strHTML = `<html><head></head><body><div id="container"><div id="one"><h3>Sunny</h3><p>Developer</p><p>Ist Floor, Shubham Complex, Ghatlodiya</p><p>Ahmedabad, Gujarat 380061</p></div><div id="two"><h3>9999999</h3><p>Specification </p></div></div></body></html>`

<ScrollView style={{ flex: 1 }}>
            <HTML html={htmlContent} tagsStyles={tagsStyles} classesStyles={classStyles} imagesMaxWidth={Dimensions.get('window').width} />
        </ScrollView>

    const styles = {
  tagsStyles: { 
      p: {margin: 2},
      h3: {margin: 2, color: 'red'}
  }

};

const classStyles = { 
  "container": { height: 200,  background: 'red'}, 
    "one": {   height: 200,float: 'left' }, 
    "two": {   marginLeft: 30,height: 200 }
};

但是 classStyles(container,one,two) 对此没有影响

【问题讨论】:

    标签: html reactjs react-native react-native-render-html


    【解决方案1】:

    你需要修改html

    身份证

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-22
      • 2019-08-09
      • 1970-01-01
      • 2019-05-02
      • 2017-06-24
      • 1970-01-01
      • 1970-01-01
      • 2021-04-30
      相关资源
      最近更新 更多