Ayman Ibrahim
Ayman Ibrahim

Reputation: 1399

What specifies placeholder alignment of the UITextField?

I have an App in two languages Arabic and English,

When flipping the UI using:

UIView.appearance().semanticContentAttribute = .forceRightToLeft
//And/Or:
UITextField.appearance().semanticContentAttribute = .forceRightToLeft

The placeholders of the textFields stays the same, I understand that the semanticContentAttribute only flips the Trailing and leading constraints.

What if I want to change the alignment of the placeholders of the textfields, with changing the semantics of the view?

Note that:

I have tried changing the textAlignment of the UITextField to all the possible values.

Upvotes: 4

Views: 1048

Answers (2)

Rayan
Rayan

Reputation: 1

textAlignment property specifies placeholder text alignment of a UITextField object.

Upvotes: 0

nadi9
nadi9

Reputation: 576

So try to do 2 things.

  1. to add arabic to your project (click + under localisations section) enter image description here

  2. choose the last option in the alignment field.

enter image description here

Upvotes: 2

Related Questions