RN-第三方之react-native-swipeout 左右滑动出现按钮

本文内容
1、左滑出现删除按钮

可以自定义滑动出来的component

https://github.com/dancormier/react-native-swipeout

RN-第三方之react-native-swipeout 左右滑动出现按钮_第1张图片
687474703a2f2f692e696d6775722e636f6d2f6f43514c4e46432e676966.gif

使用

npm install --save react-native-swipeout


import Swipeout from 'react-native-swipeout';
renderRowList(rowData, sectionID, rowID) {

        // 声明右侧按钮,更多属性访问 https://github.com/dancormier/react-native-swipeout 
        const swipeoutBtns = [
            {
                text: '删除',
                backgroundColor: 'red',
                onPress: ()=>{
                    this.deleteItem(rowID);
                },
                // 自定义component
                    component: [
                                             ],

            }
        ];
        return (

            //更多属性访问 https://github.com/dancormier/react-native-swipeout 
             {
                    this.setState({
                        sectionID,
                        rowID,
                    });
                }}
                onClose={() => console.log('===close') }
                scroll={event => console.log('scroll event') }
            >
          
                    
                      
                    
            
        )
    }
 this.renderRowList(rowData, sectionID, rowID)}
                        enableEmptySections={true}
                    />

你可能感兴趣的:(RN-第三方之react-native-swipeout 左右滑动出现按钮)