Right-aligned UITextField does not shift right

I have a UITextField right-aligned with placeholders. I did this in the Builder interface with the options: โ€œthe clear button appears when editingโ€, and โ€œclear when editing startsโ€ is not selected.

The text is correctly aligned (the first UITextField below), and when I click on the UITextField, the text moves correctly to the left to give way to the character (second UITextField below).

Now, when I click on the โ€œIโ€ sign, the field is cleared, but the placeholder does not accept the correct alignment to the right, since a clear sign is still present and visible (third UITextField below).

o

Some fields, however, do this correctly (for example, fields a and y below).

enter image description here

What could it be?

Thanks.

+4
source share
1 answer

This is actually a bug with UIKit. I had a similar problem with centering placeholder text. It will center itself, but as soon as the device is rotated, the placeholder text will not be centered. I would have to manually say that it centers itself on rotation in the code. This should all be fixed in iOS 5. Have you tried it there?

+1
source

Source: https://habr.com/ru/post/1369326/


All Articles