ios 4.2 中文本字段占位符问题

发布于 2024-10-09 02:38:29 字数 256 浏览 1 评论 0原文

我在表格自定义单元格中有一个 UITextField。我已将 TextField 文本对齐设置为 UITextAlignmentCenter。我还向此 textField 添加了占位符文本使这个 textField firstResponder 。现在,发生的事情是在 ios 3.0 & 中。 4.0,它工作完美(光标在中心闪烁并且输入的文本也在中心) 但在 ios 4.2.1 中,光标在左侧闪烁,而输入的文本始终居中对齐。如果我删除占位符文本,即使在 ios 4.2.1 中一切正常。

I have a UITextField in a table custom cell.I had set TextField text alignment to UITextAlignmentCenter.I have also added placehoder text to this textField & made this textField firstResponder .Now , what happens is in ios 3.0 & 4.0 , it works perfectlty (cursor blinks in the center & text entered is also in the center)
But in ios 4.2.1, cursor blinks in the left, while the text entered is always center aligned.If I remove placeholder text, even in ios 4.2.1 everything works well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒废 2024-10-16 02:38:29

我对这个问题的看法:

   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)中的光标位置:

alt text

iOS 4.2 中的光标位置:

alt text

如果我们注意到 4.2 中光标位置得到了改进,并且看起来比旧版本更好。

I guess Apple has made this intentionally to make it better.

My opinion regarding the issue:

   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. 

Have a look at the following screen shots.

Cursor position in prior versions (iOS 4.0 and 4.1):

alt text

Cursor position in iOS 4.2:

alt text

If we notice the cursor position is improved in 4.2 and it looks better than the older versions.

I guess Apple has made this intentionally to make it better.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文