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:
(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:
...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?