You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在SwiftUI的ScrollView-LazyVStack中自定义实现.swipeActions()?

寻求SwiftUI LazyVStack单元格滑动操作的可靠实现方案

遇到的问题

我尝试了多款第三方滑动操作库,均存在影响规模化使用的BUG:

  • SwipeActions(触发不可靠,已在GitHub提交问题)
  • SwipeActions(在Xcode 15/iOS 17上滑动动画卡顿)
  • SwipeCells(与Button或NavigationLink兼容性差)

需求

现寻求在SwiftUI的LazyVStack单元格中实现.swipeActions()的优质资源,本人为SwiftUI自定义视图开发新手。

当前CellView代码

struct CellView: View {
    
    var body: some View {
        
        NavigationView {
            ScrollView{
                LazyVStack(spacing: 0) {
                    ForEach(0..<20, id: \.self) { item in
                        NavigationLink(destination: Text("Some other Views")) {
                            Text("Item #\(item)").padding()
                        }
                        Divider()
                    }
                }
            }
            .navigationTitle("SwipeActions")
            .navigationBarTitleDisplayMode(.inline)
        }
    }
}

感谢各位的建议!

内容的提问来源于stack exchange,提问作者ayelvs

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 00:02:43