0.0.1 • Published 7 years ago

react-native-action-sheet-native v0.0.1

Weekly downloads
6
License
SEE LICENSE IN LI...
Repository
-
Last release
7 years ago

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>
    )
  }
 
...