SwiftUI Pull-Down Menu Order

Viewed 887

I'm using a pull-down menu in Swift UI.

I noticed that the menus are in reverse order in the bottom half of the screen.

I want to keep this in the same order all the time, is there any way?

import SwiftUI

let fruits: [String] = [
    "Apple",
    "Banana",
    "Grape",
    "Grape Fruit",
    "Melon",
    "Orange",
    "Persimmon",
    "Pineapple",
]

struct ContentView: View {
    var body: some View {
        NavigationView {
            GeometryReader { bounds in
                List {
                    ForEach(fruits, id: \.self) { item in
                        Menu {
                            Button (action: {}) {
                                Text("Add")
                            }
                            Button (action: {}) {
                                Text("Delete")
                            }
                        } label: {
                            Text(item)
                        }
                    }
                }
                .listStyle(PlainListStyle())
                .navigationTitle(Text("Title"))
            }
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Menu in the top half of screen Menu in the bottom half of screen

0 Answers
Related