SwiftUI Picker Label

I have set up a "Picker" which works well, EXCEPT that the Label won't appear, I have struggled around this and I am sure the solution is very simple, here's what I have.

import SwiftUI
import SwiftData

struct iPadReadingsEntry: View {
    
    @State private var whatOccasion: String = ""
    let occassions = ["Misc", "Breakfast", "Mid Day Meal", "Evening Meal", "Bed Time"]


    var body: some View {

	.
	.
	.
                HStack{
                    Picker("Before What Occasion :", selection: $whatOccasion ){
                        ForEach(occassions, id: \.self) {
                            Text($0)
                        }
                    }.pickerStyle(MenuPickerStyle())
                     .background(Color(red: 255, green: 253, blue: 208))
                    Spacer()
                }.padding(.leading, 80)
                 .padding(.bottom, 30)

	.
	.
	.
Answered by Claude31 in 789216022

Picker label does not show except in some conditions. You have to find a work around to display the label independently.

Get details here: https://stackoverflow.com/questions/69381385/swiftui-custom-picker-label-not-rendering

Accepted Answer

Picker label does not show except in some conditions. You have to find a work around to display the label independently.

Get details here: https://stackoverflow.com/questions/69381385/swiftui-custom-picker-label-not-rendering

SwiftUI Picker Label
 
 
Q