swift - SwiftUI - DragGesture 和 .onDelete 冲突
问题描述
我有手势之间的冲突:
import SwiftUI
struct ContentView : View {
@State var showSearchBar = true
var body : some View {
NavigationView {
Form {
ForEach(//code) { values in
NavigationLink(//code)
}
.onDelete(perform: //delete action)
}
.simultaneousGesture(
DragGesture()
.onChanged({ gesture in
if gesture.location.y > gesture.startLocation.y {
showSearchBar = false
} else {
showSearchBar = true
}
})
)}}}
但是,这两种手势都不起作用。如果我删除 .simultaneousGesture,则 .onDelete 有效,但如果我同时保留两者,则只有 .simultaneousGesture 有效。我怎样才能使两者都起作用?
感谢所有帮助我的人!
解决方案
建议您通过 Apple 开发人员支持提出此问题。
推荐阅读
- graphql - 在 AppSync/GraphQL 中,您如何处理需要来自多个数据源的连接数据的列表?
- c++ - 如何打印大括号之间包含的子字符串?
- javascript - 在 P5JS 中创建抽象日历
- javascript - Electron Google 登录:“此浏览器或应用程序可能不安全”
- c# - 我们应该在类库项目 asp .net core 中扩展 IServiceCollection 吗?
- c++ - Is there a binary search algorithm that takes a unary predicate rather than a search value?
- haskell - 如何在验证时迭代值
- android - `java.lang.NoClassDefFoundError: android/view/View` 尝试在 Termux 中从 android-kawa 构建“HelloWorld”项目
- docker - 如何使用 HDD 增加分配给 docker 的内存
- reactjs - 为什么复选框中存在更新状态延迟,React