react native ActionSheetIOS 使用详解
来源:互联网 发布:淘宝网买家 编辑:程序博客网 时间:2024/05/21 22:58
ActionSheetIOS 有2个方法:
1、showActionSheetWithOptions(options: Object, callback: Function)
options:(字符串数组)按钮的标题(必选)
cancelButtonIndex:选项中取消按钮索引
destructiveButtonIndex:选项中删除按钮索引
title:顶部的标题
message:标题下方的信息
2、showShareActionSheetWithOptions(options: Object, failureCallback: Function, successCallback: Function)
message:要分享的信息
url:分享的URL地址
subject:分享的信息主题
excludedActivityTypes:在actionsheet中不显示的活动
/** * Created by![这里写图片描述](http://img.blog.csdn.net/20170523172118863?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWVuZ2tzMTk4Nw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast) on 2017/5/23. */import React, {Component} from 'react';import { StyleSheet, View, ActionSheetIOS, Button, Alert,} from 'react-native';export default class ActionSheetIOSDemo extends Component { _onPress = ()=>{ ActionSheetIOS.showActionSheetWithOptions({ options:['option1','option2','取消','删除'], cancelButtonIndex:2, destructiveButtonIndex:3, title:'title', message:'message', },(index)=>{ Alert.alert('选中:'+index); }) } _onPress1 = ()=>{ ActionSheetIOS.showShareActionSheetWithOptions({ message:'message', url:'http://blog.csdn.net/mengks1987', subject:'subject', title:'title', message:'message', },()=>{ },()=>{ }) } render() { return ( <View style={{flex:1}}> <Button title='弹出' onPress={this._onPress}/> <Button title='弹出分享' onPress={this._onPress1}/> </View> ); }}
github下载地址
阅读全文
0 0
- react native ActionSheetIOS 使用详解
- React Native——ActionSheetIOS
- 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 使用详解
- react native DatePickerIOS 使用详解
- react native DrawerLayoutAndroid 使用详解
- react native Image 使用详解
- react native Modal 使用详解
- react native Picker 使用详解
- react native ProgressBarAndroid 使用详解
- [ZOJ 3747] Attack on Titans (计数DP + 连续至多 + 连续至少)
- tf.concat的用法
- hdu 4812 multik
- 安卓随笔记录
- eclipse查看一个接口的所有实现类
- react native ActionSheetIOS 使用详解
- 洛谷 P1006 传纸条(NOIP2008提高组第三题)
- 预定义异常
- ReentrantLock 理解
- EventBus用法详解
- oracle数据库-归档模式/非归档模式修改
- 手把手教你新建一个基于 Maven 的 idea 项目(Web 项目)
- golang使用gopacket包进行数据包捕获,注入和分析
- SQL语法之自定义函数UDF