简体   繁体   中英

UITextField with placeholder right aligned don't move correctly to the right

I have some UITextField, right aligned, with placeholders. I made it in Interface Builder with options: "clear button appears while editing", and "clear while editing begins" is deselected.

The text is correctly right aligned (first UITextField below), and when I tap in a UITextField, the text correctly move to left to give way to the clear sign (second UITextField below).

Now, when I tap on the clear sign, the field clears BUT the placeholder does not take the proper alignment to right, as the clear sign were still present and visible (third UITextField below).

Ø

Some fields, however, do it right (eg a and y fields here below).

在此输入图像描述

What could it be?

Thank you.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM