react-native-htmlview 是一个将 HTML 目录作为本地视图的控件,其风格可以定制。
应用示例:
代码示例:
var React = require('react-native') var {Text, View, ListView} = Reactvar HTMLView = require('react-native-htmlview') var ContentView = React.createClass({ render() { return ( var htmlContent = '<p><a href="">♥ nice job!</a></p>' <HTMLView value={htmlContent} onLinkPress={(url) => console.log('navigating to: ', url)} stylesheet={styles} /> ) } })