import React from 'react'; import { Modal, Text, TouchableHighlight, TouchableOpacity, View, StyleSheet, Image, TextInput } from 'react-native'; let Dimensions = require('Dimensions'); let screenWidth = Dimensions.get('window').width; let dialogWidth = screenWidth - 40; class YRModel extends React.Component { constructor(props) { super(props); this.state = { name: 'YRModel', modalVisible: false }; } setModalVisible(visible) { this.setState({modalVisible: visible}); } componentDidMount() { } render() { /*自定义对话框*/ return ( { this.setModalVisible(false) }}> {/* */} { this.setModalVisible(!this.state.modalVisible) }}> 重置 { this.setModalVisible(!this.state.modalVisible) }}> 确认 {/* */} { this.setModalVisible(true) }}> 弹出对话框 ) } } const styles = StyleSheet.create({ page:{ flex: 1, justifyContent: 'center', }, container: { flex: 1, justifyContent: 'center', padding: 20, backgroundColor: 'rgba(0, 0, 0, 0.5)' }, innerContainer: { borderRadius: 3, alignItems: 'center', backgroundColor: '#fff', borderColor:"#fff", borderWidth:1, }, header:{ width:dialogWidth, flexDirection:'row', justifyContent:'flex-start', padding:8 }, content:{ borderColor:"#82D2F8", }, btnContainer:{ flexDirection:"row", justifyContent:"flex-end", width:dialogWidth, borderTopWidth:1, paddingTop:10, borderTopColor:'#E7E7E7', alignItems:'center', padding:3 }, inputtext:{ width:dialogWidth-20, margin:10, }, textSure: { color:"#fff" }, textClose:{ color:"#82D2F8" }, textContainer:{ borderColor:"#fff", borderWidth:1, flexDirection:'row', justifyContent:"center", alignItems:"center", }, btnClose:{ borderColor:"#82D2F8", borderWidth:1, borderRadius:5, paddingTop:6, paddingBottom:6, paddingLeft:20, paddingRight:20, backgroundColor:"#fff" }, btnSure:{ borderColor:"#82D2F8", borderWidth:1, borderRadius:5, paddingTop:6, paddingBottom:6, paddingLeft:20, paddingRight:20, margin:10, backgroundColor:"#82D2F8" } }); export default YRModel;