ios – MenuPicker: Change Dropdown Type (SwiftUI)

0
53


I’ve used this StackOverflow Submit to create a customized menu picker in SwiftUI:

struct MenuPicker: View {
    @State var choice: String = "Choice 1"
    let menuOptions: [String] = ["Option 1", "Option 2", "Option 3"]
    
    var physique: some View {
        Menu {
            Picker(choice: $choice,
                    label: EmptyView(),
                    content material: {
                        ForEach(menuOptions, id: .self) { choice in
                            Textual content(choice)
                                .tag(choice)
                        }
                    }
            )
            .pickerStyle(.automated)
        } label: {
            Textual content(choice)
                .foregroundStyle(.white)
                .padding(.vertical, 8)
                .padding(.horizontal)
                .background(.blue.opacity(0.7))
                .cornerRadius(10)
        }
    }
}

When altering the choice, the dropdown appears as follows:

Dropdown Menu

Find out how to change the looks of the dropdown? I wish to change background coloration (e.g. crimson), textual content coloration (e.g. inexperienced), and divider (e.g. white).