How to fix a Form Picker or a NavigationLink that isn't tappable
About 2 min
How to fix a Form Picker or a NavigationLink that isn't tappable 관련
SwiftUI by Example
Back to Home
How to fix a Form Picker or a NavigationLink that isn't tappable | SwiftUI by Example
How to fix a Form Picker or a NavigationLink that isn't tappable
Updated for Xcode 15
If you have a NavigationLink
or Picker
that isn’t working, this usually happens because in some situations SwiftUI expects the containing view to be inside a NavigationStack
. So, you might see a list row showing a disclosure indicator, but for it to appear disabled.
To fix the problem, wrap your view in a NavigationStack
, like this:
NavigationStack {
NavigationLink {
Text("Detail view")
} label: {
Text("Show detail view")
}
}
Similar solutions…
How to create a tappable button | SwiftUI by Example
How to create a tappable button
How to create a picker and read values from it | SwiftUI by Example
How to create a picker and read values from it
How to control the tappable area of a view using contentShape() | SwiftUI by Example
How to control the tappable area of a view using contentShape()
How to hide the label of a Picker, Stepper, Toggle, and more using labelsHidden() | SwiftUI by Example
How to hide the label of a Picker, Stepper, Toggle, and more using labelsHidden()
How to create a date picker and read values from it | SwiftUI by Example
How to create a date picker and read values from it