I am working on an English / Arabic app that has localization. In one textfield I have set textAlignment
property as right
. But the content, numeric, displayed at right side.
I double checked it by debugging textAlignment
property value and it indeed is right
.
I have set alignment property programatically, as it will be changing as per language selection (i.e. on button tap). Then I set value in it and is being displayed as right aligned.
The thing is when I select the text field, suddenly the content moves to right side and displays as aligned right.
I change the layout to RTL and LTL programmatically with the following line:
UIView.appearance().semanticContentAttribute = .forceRightToLeft
I can't find a solution.