Table cell view is not right-aligned
For your stack representation, you must be alignment
set to Leading
so that it starts in the leading position for your language, which is the best side for you. Then set Semantic
to Force Right-to-Left
.
It is important that you snap the edges of the stack to the edges of the container so that the stack view determines the size of the container. It is also important that you give the labels a dynamic size. Both of these conditions seem to occur in your code, although it's not entirely clear.
source to share
If you use restrictions leading
and trailing
to place your items UILabel
, everything automatically switches to the correct site if the language is right to left. There is no need to change NSTextAlignment
( .natural
the default and the one you want) or UISemanticContentAttribute
for UILabel
.
Keep in mind that at least one RTL language must be added to localize a project:
When your iPhone / iPad language is set to Hebrew, everything should work as expected:
source to share