I am trying to right-align my table cells.
I have set 'Semantic' property to 'Force Right-to-Left' value through the whole visual tree.
Desired layout:
Visual tree:
There aren't any visual definitions in code...
EDIT:
After @dirtydanee suggestion:
6 Answers
Answers 1
For your stack view you should have alignment
set to Leading
to make it start at the leading position for your language, which is the right most side for you. Then you set Semantic
to Force Right-to-Left
.
It is important that you have tied the stack views edges to it's container's edges, so that the stack view will size to it's container. It is also important that you let the labels have dynamic size. Both of these conditions seems to be met in your code, although it is not entirely clear.
Answers 2
Just do following thing to assign text right side in tableviewCell
Step 1: Select view in contect View cell in StoryBoard
Step 2: Alignment text to right side.
Answers 3
It seems that your constraints are wrong.
Constrain your labels to the right and align their text to the right.
Here is an example:
And running on simulator:
Answers 4
If you use leading
and trailing
constraints to layout your UILabel
elements, everything gets switched automagically to the right site if using a Right-To-Left language. There is no need to change the NSTextAlignment
(.natural
is default and the one you need) or the UISemanticContentAttribute
of the UILabel
.
Be aware that you need to have at least one RTL language added to your project localizations:
When the language of your iPhone / iPad is set to Hebrew everything should work as expected:
Answers 5
It is also depend on Your Device Selected Lang.
You can try to use left
instead of leading
and use right
instead of trailing
Answers 6
I tried a demo and i think what you need to do is set semantic for each label separately
go to perekSourcelabel set semantic right-to-left then do same for header label
dont set semantic for your stack view or the whole perekTableViewcell
0 comments:
Post a Comment