美文网首页React Native学习
RN跳转详情页面,用HTML显示

RN跳转详情页面,用HTML显示

作者: 废材helloword | 来源:发表于2018-11-11 23:37 被阅读5次

import React, { Component } from "react";

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

import HTML from "react-native-render-html";

export default class Detils extends Component {


//标题

  static navigationOptions = ({ navigation }) => {

    return {

      title: navigation.getParam("name").title

    };

  };

  constructor(props) {

    super(props);

    this.state = {

      content: this.props.navigation.getParam("name").content

    };

  }

  render() {

    return (

      <ScrollView>

        <HTML

          html={this.state.content}

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

        />

      </ScrollView>

    );

  }

}

相关文章

网友评论

    本文标题:RN跳转详情页面,用HTML显示

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