ReactNative-Modal(模态窗口)类似Android中PopupWindow弹窗
来源:互联网 发布:php 爬虫 解析html 编辑:程序博客网 时间:2024/05/29 17:06
ReactNative中的Modal组件Android IOS都可使用
主要属性
visible 设置是否显示
animationType设置显示是的动画
slide 从下往上滑动出现
fade 慢慢显示
none 没有动画 默认transparent 设置是否透明默认是不透明
onRequestClose 关闭时调用此方法
onShow 显示时调用
/** * Created by Administrator on 2016/9/7. */import React, {Component} from 'react';import { AppRegistry, StyleSheet, View, Modal, Text,} from 'react-native'class ModalG extends Component { constructor(prop) { super(prop); this.state = { modalVisible: false } } render() { return ( <View style={{flex: 1, backgroundColor: 'green'}}> <Modal visible={this.state.modalVisible} //显示是的动画默认none //从下面向上滑动slide //慢慢显示fade animationType = {'slide'} //是否透明默认是不透明 false transparent = {true} //关闭时调用 onRequestClose={()=> this.onRequestClose()} > <View style={{marginTop:100, marginLeft:100, width:100, height:100, backgroundColor:'red'}}> <Text onPress={()=> this.setState({modalVisible: false})}>点击关闭Modal</Text> </View> </Modal> <Text onPress={() => this.showModal()}>点击显示Modal</Text> </View> ) } showModal() { this.setState({ modalVisible: true }) } onRequestClose() { this.setState({ modalVisible: flase }) }}module.exports = ModalG;
0 0
- ReactNative-Modal(模态窗口)类似Android中PopupWindow弹窗
- Android 中 PopupWindow 点击窗口外消失
- (四十五)Modal 模态窗口 -遮盖
- AngularJs 弹出模态窗口 $modal $uibModal
- android 中popupwindow 和类似360悬浮小球
- Android窗口之PopupWindow
- Android弹出窗口PopupWindow
- Android 弹出窗口 PopupWindow
- Android PopupWindow窗口
- ReactNative 组件封装---Modal
- android中使用PopupWindow实现弹出窗口菜单
- Ionic最佳实践-使用模态窗口modal
- CSS Modal—纯CSS实现模态窗口
- bootstrap modal模态窗口拖拽功能
- bootstrap打开模态modal窗口引起页面抖动解决办法
- android-PopupWindow弹出窗口 - 随心
- 解决Bootstrap模态窗口Modal中使用Kindeditor或UEditor编辑器第二次无法加载的问题
- 解决Bootstrap模态窗口Modal中使用Kindeditor或UEditor编辑器第二次无法加载的问题
- os 10.11.5 安装最新的Cocopods 解决方案
- 演示DateFormat
- part1:再论NSString属性的三观
- C++的explicit关键字
- BW中的激活程序
- ReactNative-Modal(模态窗口)类似Android中PopupWindow弹窗
- Android开发之资源文件存储
- 建议59:不要在不恰当的场合下引发异常
- spring tool suite新建spring starter project,写一个简单的html页面并运行出来
- 对话框
- Android中事件分发机制的总结
- ADB常用命令
- 百练+幻方+按照规则模拟
- java 关于读取excel表内的日期时间