react native Alert AlertIOS 使用详解
来源:互联网 发布:淘宝卖文具赚钱吗 编辑:程序博客网 时间:2024/06/10 08:47
Alert:提示对话框,只有1个方法:
static alert(title: ?string,message?: ?string,buttons?: Buttons,options?: Options,type?: AlertType,)
- title:标题
- message:内容
- buttons:按钮数组
- options(android):其余参数,只有一个参数 cancelable。
- type:过期,可以使用AlertIOS.prompt()替代。
/** * Created by on 2017/5/24. */import React, {Component} from 'react';import { StyleSheet, View, Button, Alert,} from 'react-native';export default class AlertDemo extends Component { static navigationOptions = { title: 'Alert' } _alert = () => { // Alert.alert('title'); // Alert.alert('title','Message'); Alert.alert('Alert Title', 'Alert Message', [ { text: '稍后再说', onPress: () => { Alert.alert('', '点击了稍后再说') } }, { text: '取消', style: 'cancel', onPress: () => { Alert.alert('', '点击了取消') }, }, { text: '确定', onPress: () => { Alert.alert('', '点击了确定') } }, { text: '确定1', onPress: () => { Alert.alert('', '点击了确定') } }, ], {cancelable: false}, ); } render() { return ( <View style={{flex:1}}> <Button title='Alert' onPress={this._alert}/> </View> ); }}
github下载地址
阅读全文
0 0
- react native Alert AlertIOS 使用详解
- React-Native——AlertIOS
- react-native-Alert
- React Native 之Alert
- react-native-modal-alert
- react-native Alert组件
- React Native API模块之Alert弹出框详解及使用
- React Native-15.React Native 常用API及实践 AlertIOS AlertSheetIOS
- react native ActivityIndicator使用详解
- react native Button 使用详解
- react native Text 使用详解
- react native Switch使用详解
- react native ScrollView 使用详解
- react native FlatList 使用详解
- react native SectionList 使用详解
- react native TextInput 使用详解
- react native Slider 使用详解
- react native StatusBar 使用详解
- JS的书写格式
- 技术文章的阅读姿势
- EditText 设置可编辑不可编辑
- android多图选择 图片/视频 单选or多选,以及视频录制
- 浅谈InnoDB的MVCC策略
- react native Alert AlertIOS 使用详解
- Caffe 中 BN(BatchNorm ) 层的参数均值、方差和滑动系数解读
- RESTful API设计指南
- [iOS]删除相册图片
- Python 文件夹遍历和文件查找
- 快速实现:删除和预览当前选择需要上传的图片
- hibernate性能优化记录
- Grails输出jdbc查询sql
- hibernate-提纲