数据解析跳转详情-Details

2018-11-16  本文已影响0人  YH6666

import React, { Component } from "react";

import { ScrollView, StyleSheet, Dimensions, View } from "react-native";

import HTML from "react-native-render-html"; //渲染html成原生内容

export default class Details extends Component {

  /**

  * 初始化构造方法

  */

  constructor(props) {

    super(props);

  }

  /**

  * 元素渲染

  */

  render() {

    var content = this.props.navigation.getParam("abc", "123");

    return (

      <View style={styles.container}>

        <ScrollView style={{ flex: 1 }}>

          <HTML

            html={content}

            imagesMaxWidth={Dimensions.get("window").width - 20}

          />

        </ScrollView>

      </View>

    );

  }

}

/**

* 样式表

*/

const styles = StyleSheet.create({

  container: {

    flex: 1,

    backgroundColor: "#F5FCFF"

  },

  welcome: {

    flex: 1

  }

});

上一篇 下一篇

猜你喜欢

热点阅读