React native 使用滑动节列表删除节

React native 使用滑动节列表删除节,react-native,react-native-sectionlist,React Native,React Native Sectionlist,我是新来的 我想要一个分区列表,可以通过滑动删除功能。 我找到了这个库:react native swipeout 这对FlatList很有效, 我设法只将滑动添加到节标题,但我想将整个节作为一个单元一起滑动 添加当前情况的图像 灰色背景是节标题,白色背景是数据数组 代码片段 renderSectionHeader = ({section, index}) => { const swipeSettings = { autoClose: true,

我是新来的 我想要一个分区列表,可以通过滑动删除功能。 我找到了这个库:react native swipeout 这对FlatList很有效, 我设法只将滑动添加到节标题,但我想将整个节作为一个单元一起滑动

添加当前情况的图像

灰色背景是节标题,白色背景是数据数组 代码片段

renderSectionHeader = ({section, index}) => {

    const swipeSettings = {
        autoClose: true,
        onColse: (secId, rowId, direction) => {

        },
        onOpen: (secId, rowId, direction) => {

        },
        right: [
            {
                onPress: () => {
                },
                text: 'Remove', type: 'delete'
            }
        ],
        rowId: 1,
        sectionId: index,
        //  set active swipeout item
        _handleSwipeout: (sectionID, rowID) => {
            for (var i = 0; i < rows.length; i++) {
                rows[i].active = i == rowID;
            }
            this._updateDataSource(rows)
        },
    };

    return (

        <Swipeout
            {...swipeSettings}
        >
            <View style={{justifyContent: 'space-between'}}>
                <Text>{section.itemName}</Text>
                <Text>${section.itemTotalPrice}</Text>
            </View>
         </Swipeout>

    )
};
renderSectionHeader=({section,index})=>{
常数swipeSettings={
自动关闭:是的,
onclse:(secId,rowId,direction)=>{
},
onOpen:(secId,rowId,direction)=>{
},
对:[
{
onPress:()=>{
},
文本:“删除”,键入:“删除”
}
],
罗维德:1,
第ID部分:索引,
//设置活动swipeout项
_handlesweepout:(sectionID,rowID)=>{
对于(变量i=0;i