【问题标题】:How we create the list View Swipeout in React native我们如何在 React Native 中创建列表 View Swipeout
【发布时间】:2017-04-17 05:02:41
【问题描述】:

我想在 React native 的 listView 中创建一个 swipeour。我使用这个链接 ListView Swipeout 创建 但是这个链接不起作用。请给我创建一个swipout的代码,如这个链接https://medium.com/@bddougie/adding-swipe-to-delete-in-react-native-cfa85a5f5a31

【问题讨论】:

    标签: react-native


    【解决方案1】:

    您分享的上述链接在 ios 上可以正常工作,但在 android 上不行。 我尝试过使用 React Native 滑动列表视图

    用法片段:

    import { SwipeListView } from 'react-native-swipe-list-view';
    render() {
        const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
        return (
            <SwipeListView
                dataSource={ds.cloneWithRows(dataSource)}
                renderRow={ data => (
                    <View style={styles.rowFront}>
                        <Text>I am {data} in a SwipeListView</Text>
                    </View>
                )}
                renderHiddenRow={ data => (
                    <View style={styles.rowBack}>
                        <Text>Left</Text>
                        <Text>Right</Text>
                    </View>
                )}
                leftOpenValue={75}
                rightOpenValue={-75}
            />
        )
    }
    

    更多信息请参考以下链接: https://github.com/jemise111/react-native-swipe-list-view

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-21
      • 2022-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多