我在表格自定义单元格中有一个UITextField。我将TextField文本对齐设置为UITextAlignmentCenter.我还添加了占位符文本到这个textField中,并制作了这个textField firstResponder .Now,在iOS3.0和4.0中发生了什么,它工作得很完美(光标在中心闪烁,输入的文本也在中心),但在iOS4.2.1中,光标在左边闪烁,而输入的文本总是居中aligned.If我删除了占位符文本,即使在iOS4.2.1中一切都运行得很好。
发布于 2010-12-27 17:49:00
我对这个问题的看法是:
If you notice the cursor position in prior versions(iOS 4.0 and 4.1),
you can notice that the cursor is not placed exactly at the center of the
placeholder text. But in 4.2 the cursor is placed neatly at the left side of
the placeholder. 看看下面的屏幕截图。
早期版本(iOS 4.0和4.1)中的光标位置:

iOS 4.2中的光标位置:

如果我们注意到光标位置在4.2中得到了改进,它看起来比旧版本更好。
I guess Apple has made this intentionally to make it better.https://stackoverflow.com/questions/4536929
复制相似问题