自适应高度,区分android 和ios
/**
* Created by ke2933 on 2018/11/08
* WebModul WebView 封装
* webContent WebView 内容
*/
import React, { Component } from 'react';
import { StyleSheet, Text, View, WebView, Alert, ScrollView } from 'react-native';
const BaseScript =
`
(function () {
var height = null;
function changeHeight() {
if (document.body.scrollHeight != height) {
height = document.body.scrollHeight;
if (window.postMessage) {
window.postMessage(JSON.stringify({
type: 'setHeight',
height: height,
}))
}
}
}
setTimeout(changeHeight, 300);
} ())
`
export default class TabNav extends Component {
static defaultProps = {
webContent: "",
};
constructor(props) {
super(props);
this.state =