npm.io
0.0.1 • Published 9 years ago

react-native-action-sheet-native

Licence
SEE LICENSE IN LICENSE
Version
0.0.1
Deps
0
Vulns
0
Weekly
0

react-native-action-sheet-native

react-native-action-sheet-native is a JavaScript library for React Native, it implements AcionSheet for Android relys on AndroidActionSheet.

Screenshots

IOS

IOS

ANDROID

ANDROID

Installation
npm install react-native-action-sheet-native --save
react-native link react-native-action-sheet-native
Usage
...
import ActionSheet from 'react-native-action-sheet-native'
...

const IMAGE_PICKER_OPTIONS = ['Quay lại', 'Thư viện ảnh', 'Chụp ảnh mới']

...

  render() {
    return (
      <View style={styles.container}>
        <TouchableOpacity onPress={() => this.actionSheetRef.show()}>
          <Text>Show</Text>
        </TouchableOpacity>
        <Text> Selected index: {`${this.state.index}`}</Text>
        <ActionSheet
          cancelButtonIndex={0}
          destructiveButtonIndex={1}
          options={IMAGE_PICKER_OPTIONS}
          ref={actionSheetRef => (this.actionSheetRef = actionSheetRef)}
          title={'Chọn ảnh từ:'}
          onPress={index => this.setState({ index })}
        />
      </View>
    )
  }
 
...

Keywords