0

I'm trying to add RTL support to my iOS 16 lock screen widgets (.accessoryRectangular family), but haven't been successful so far.

This is my code:

@available(iOS 16.0, *)
struct MyAccessoryView: View {
  var body: some View {
    ZStack {
      AccessoryWidgetBackground()
      HStack {
        Text("First")
        Text("Second")
      }
    }
  }
}

Which gives me:

enter image description here

(The "First" label should be to the right)

If I append the .environment(\.layoutDirection, .rightToLeft) modifer to e.g. the ZStack, I can force the RTL layout:

enter image description here

...But leaving it in the hands of the system language doesn't seem to do the trick.

Is this an Apple bug, or am I missing something in my implementation?

Nicolas Miari
  • 16,006
  • 8
  • 81
  • 189

0 Answers0