import React, {Component} from 'react'; import {Modal,View,Text,TouchableOpacity,Image,StyleSheet} from 'react-native'; export default class ModalContent extends Component { constructor(props) { super(props);//这一句不能省略,照抄即可 this.state = { animationType: 'fade',//none slide fade modalVisible: false,//模态场景是否可见 transparent: true,//是否透明显示 }; } render() { return { this._setModalVisible(false) }} onShow={this.startShow} > { this._setModalVisible(false) }}> { return }}> 我的二维码 当前页面不可转发 回到首页 添加到我的小程序 添加到桌面 浮窗 设置 反馈与投诉 { this._setModalVisible(false) }}> 取消 } _setModalVisible = (visible) => { this.setState({modalVisible: visible}); } startShow = () => { // alert('开始显示了'); } } const styles = StyleSheet.create({ modalContainer:{ flex:1, justifyContent:'flex-end', backgroundColor:'rgba(0, 0, 0, 0.5)' }, modalContent:{ backgroundColor:'#ddd', borderTopLeftRadius:5, borderTopRightRadius:5 }, modalTitle:{ height:60, borderBottomWidth:1, borderBottomColor:'#ccc', justifyContent:'center', marginLeft:10, }, operationButton:{ flexDirection:'row', justifyContent:'flex-start', marginTop:10, flexWrap:'wrap', paddingBottom:10, borderBottomWidth:1, borderBottomColor:'#ccc', }, operationButtonSpace:{ marginLeft:10, marginTop:10 }, operationButtonImgContainer:{ width:60, height:60, alignItems:'center', justifyContent :'center', borderRadius:15, backgroundColor:'#fff' }, operationButtonImg:{ width:20, height:20 }, operationButtonText:{ alignItems:'center', textAlign :'center', width:60, marginTop:10, fontSize:12 }, modalCancleButton:{ alignItems:'center', justifyContent :'center', backgroundColor:'#fff', height:40 } });