效果如图:
代码:
react native版本0.39.0
/**
* Created by xq on 16/12/6.
*/
import React, { Component ,PropTypes} from 'react';
import {
Text,
View,
TouchableOpacity,
StyleSheet,
Platform,
Dimensions,
Image,
Modal,
TextInput,
InteractionManager
} from 'react-native';
export default class AlertModal extends Component{
constructor(props){
super(props)
this.state = { visible: this.props.visible };
}
close=()=>{
this.setState({ visible: false });
}
componentWillReceiveProps(props) {
this.setState({ visible: props.visible });
}
renderC