react-native-actionsheet
react-native-actionsheet是一个React Native的ActionSheet组件。
安装(install)
npm install react-native-actionsheet --save
Usage(用法)
import ActionSheet from 'react-native-actionsheet'
this.ActionSheet = o}
title={'Which one do you like ?'}
options={['Apple', 'Banana', 'cancel']}
cancelButtonIndex={2}
destructiveButtonIndex={1}
onPress={(index) => { /* do something */ }}
/>
title:
标题
tintColor:
列表中按钮的颜色
message:
显示在标题下方的文字
options:
按钮标题列表
cancelButtonIndex:
选项中取消按钮的索引
destructiveButtonIndex:
选项中显示为红色按钮的索引
onPress:
回调函数采用一个参数,即选定项的从零开始的索引