简体   繁体   English

SwiftUI 列表项实现滑动多个动作

[英]SwiftUI List Items implement swipe multiple actions

Is multiple actions not yet supported with SwiftUI when swipe List items?滑动列表项时 SwiftUI 是否尚不支持多个操作?

This is really disappointed I can't find a way to implement this using SwiftUI.这真的很失望,我找不到使用 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:)您可以使用滑动操作(受 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)
                    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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