Skip to content

Click on swipe listview renderHiddenRow is visible #116

Closed
@MhtSuthar

Description

@MhtSuthar

All are implement is very good but i have implement click on your swipe list view than hidden row visible, how to resolve this issue, i use this code for row
renderRow(rowData, sectionID, rowID) {
return (
<TouchableOpacity onPress={() => this.clickMinimize(rowData, sectionID, rowID)} >

I am {rowData.row} in a SwipeListView
I am {""+rowData.isSelect}


);
}

and this fir hiddenrow
renderHiddenRow(rowData, sectionID, rowID, rowMap) {
return (

Left
<TouchableOpacity onPress={() => this._onPressRow(rowID, rowData, sectionID, rowMap)}>
<Image
source={require('../images/ic_delete.png')} style={{ width: 30, height: 30, marginLeft: 0, marginRight: 0 }} />


);
}

Activity

alexcoady

alexcoady commented on Apr 13, 2017

@alexcoady

@MhtSuthar The nature of this plugin is that the hidden row sits behind the visible row, if you're using TouchableOpacity in your normal renderRow function, you will see the hidden row behind while transparency is applied.

You could use TouchableHighlight and set the underlayColor to be the color you want to see through the clicked item. This will stop the hidden UI being visible on press.

Using this approach your renderRow function might look like this:

renderRow (rowData, sectionID, rowID) {
  
  return (
    <TouchableHighlight underlayColor="red" activeOpacity={.6} onPress={onPress}>
      <View>
        <Text>I am {rowData.row} in a SwipeListView</Text>
        <Text>I am {""+rowData.isSelect}</Text>
      </View>
    </TouchableHighlight>
  );
}
jemise111

jemise111 commented on Oct 20, 2017

@jemise111
Owner

@alexcoady Is absolutely right. I would recommend using a TouchableHighlight instead of TouchableOpacity. Going to close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexcoady@jemise111@MhtSuthar

        Issue actions

          Click on swipe listview renderHiddenRow is visible · Issue #116 · jemise111/react-native-swipe-list-view