imobile_for_reactnative
Version:
iMobile for ReactNative,是SuperMap iMobile推出的一款基于React-Native框架的移动应用开发工具。基于该开发工具,用户可以使用JavaScript开发语言,开发出在Android和IOS操作系统下运行的原生移动GIS应用,入门门槛低,一次开发,处处运行。
79 lines (64 loc) • 1.34 kB
JavaScript
import * as React from 'react'
import {
requireNativeComponent,
ViewPropTypes,
StyleSheet,
View, Platform,
AppState,
} from "react-native";
import PropTypes from 'prop-types'
class SMRectifyView extends React.Component {
props: {
language: String,
}
constructor() {
super()
AppState.addEventListener('change', this.handleStateChange)
this.stateChangeCount = 0
}
state = {
viewId: 0,
}
static propTypes = {
onArObjectClick: PropTypes.func,
...ViewPropTypes,
};
/************************** 处理状态变更 ***********************************/
handleStateChange = async appState => {
if (Platform.OS === 'android') {
return
}
if (appState === 'inactive') {
return
}
}
render() {
var props = { ...this.props };
return (
<View
style={styles.container}
>
<RCTRectifyView
ref={ref => this.RCTRectifyView = ref}
{...props}
style={styles.view}
/>
</View>
);
}
}
var styles = StyleSheet.create({
view: {
flex: 1,
alignSelf: 'stretch',
},
container: {
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
right: 0,
},
});
var RCTRectifyView = requireNativeComponent('RCTRectifyView', SMRectifyView)
export default SMRectifyView