2022-07-04-ReactNative怎么渲染iframe页面source

2022-07-04

React Native 怎么渲染 iframe 页面

WebView & source html

// old
import { WebView } from "react-native";

# install
$ yarn add react-native-webview
# link
$ react-native link react-native-webview

// new 
import { WebView } from "react-native-webview";

WebView


/**
 *
 * @author xgqfrms
 * @license MIT
 * @copyright xgqfrms
 *
 * @description WebViewIframe
 * @augments
 * @example
 *
 */
import React, {Component} from "react";
import {
    StyleSheet,
    Dimensions,
    Text,
    View,
    WebView
} from "react-native";
// 获取设备的宽度和高度
let {
    height: deviceHeight,
    width: deviceWidth
} = Dimensions.get("window");
class WebViewIframe extends Component {
    render() {
        return (
            
              
              
            
        );
    }
}
// css-in-js
const styles = StyleSheet.create({
    container: {
        flex: 1,
        paddingTop:20
    }
});
export default WebViewIframe;
export {
    WebViewIframe,
};

new version

Render HTML in React Native

©xgqfrms 2012-2020

发布文章使用:只允许注册用户才可以访问!

分类:

技术点:

相关文章:

© 版权声明
THE END
喜欢就支持一下吧
点赞122赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容