1.0.3 • Published 7 years ago

react-native-swipe-row v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

react-native-swipe-row

Getting started

npm install react-native-swipe-row --save

Example usage

class app extends Component {

  getRightButtons() {
    return [
      {
        text: '标记已读',
        buttonContainer: styles.markAsReadButtonContainer,
      },
      {
        text: '删除',
        buttonContainer: styles.deleteButtonContainer,
      },
    ];
  }

  render() {
    return (
      <View style={styles.container}>
        <SwipeRow rightButtons={this.getRightButtons()}>
          <View style={styles.contentContainer}>
            <Text style={styles.textStyle}>hello world! this is the first swipe row</Text>
          </View>
        </SwipeRow>
        <SwipeRow rightButtons={this.getRightButtons()}>
          <View style={styles.contentContainer}>
            <Text style={styles.textStyle}>hello world! this is second swipe row</Text>
          </View>
        </SwipeRow>
      </View>
    );
  }
}

Properties

PropDescriptionDefault
childrenthe row contentNone
rightButtonsthe button which will be shown when swipe the row, this prop is an object, this object has field text, OnPress, buttonContainer and textStyleNone