'How to hide label associated with disclosure button in picker displayed in form
Solution 1:[1]
No, you can't hide the selected value. But you can use NavigationLink as a work-around:
struct ContentView: View {
@State private var input = ""
@State private var active = false
var body: some View {
NavigationView {
Form {
NavigationLink("What is your favourite city?", isActive: $active) {
List {
Button("Rome") {
input = "Rome"
active = false
}
Button("Paris") {
input = "Paris"
active = false
}
Button("Berlin") {
input = "Berlin"
active = false
}
Button("New York") {
input = "New York"
active = false
}
}
}
}
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ChrisR |

