ios – SwiftUI Menu content flipped in RTL language


in project.pbxproj I changed developmentRegion to ar to force arabic language and RTL layout in entire app, everything looks good except Menu view content in this example:

import SwiftUI

struct ContentView: View {
    
    @State private var selectedTime: Int = 0
    
    var body: some View {
        Form {
            Picker("", selection: $selectedTime) {
                Text("صباحاً").tag(0)
                Text("مساءً").tag(1)
            }
            .labelsHidden()
            .pickerStyle(SegmentedPickerStyle())
            Menu {
                Button("السبت", action: {})
                Button("الأحد", action: {})
                Button("الاثنين", action: {})
                Button("الثلاثاء", action: {})
                Button("الاربعاء", action: {})
                Button("الخميس", action: {})
                Button("الجمعة", action: {})
            } label: {
                Label("اليوم", systemImage: "calendar")
            }
        }
    }
}

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

the buttons’ labels inside Menu is flipped

Menu button label is flipped

any help is appreciated, thank you

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img