Adding CSS styling to React Native WebView

前端 未结 2 1964
小蘑菇
小蘑菇 2021-02-20 11:31

So I am a bit stumped on this ... I\'m using a WebView in a portion of our app, the reason for the WebView is because we are pulling from an API endpoint that returns to us an H

2条回答
  •  太阳男子
    2021-02-20 11:59

    I used this link. The reason I choose this solution over the accepted answer is because I can style html tags using react native styles instead of injecting style declaration string before the actual content.

    const htmlStyles = { p: {fontFamily: 'Lato'} }
    const htmlContent = 

    My Html

    ;

提交回复
热议问题