简体   繁体   中英

SwiftUI List Items implement swipe multiple actions

Is multiple actions not yet supported with SwiftUI when swipe List items?

This is really disappointed I can't find a way to implement this using SwiftUI.

Need some advices folks I really do need to implement something similar

在此处输入图像描述

You can use swipe actions (supported by ios 15>) https://developer.apple.com/documentation/swiftui/view/swipeactions(edge:allowsfullswipe:content:)

  .swipeActions(edge: .leading, allowsFullSwipe: false) {
                        Button {
                            action = "Star"                      
                        } label: {
                            Label("Star", systemImage: "star.circle")
                        }
                        .tint(.yellow)
                    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM