I created a simple Picker like so:
struct ContentView: View {
private let options = ["Action", "Comedy", "Drama", "Horror", "Zombie"]
@State var selection = "Action"
var body: some View {
VStack {
Picker("Select Genre", selection: $selection) {
ForEach(options, id: \.self) { item in
HStack {
Text(item)
Image(systemName: "heart.fill")
}
}
}
}
.padding()
}
}
When it displays I can see that it is slightly left aligned in the screen. Is there any way to fix this? Also, is there any way to detect when the Picker is showing its options?


.wheel.