我的手势之间存在冲突:
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 开发者支持提出此问题。
关于SwiftUI - DragGesture 和 .onDelete 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65082347/