UITextField 占位符RectForBounds
我想创建一个 UITextField,其中占位符向左对齐,文本向中心对齐。我搜索了一下,发现 placeholderRectForBounds: 函数苹果文档说如果你想覆盖,但没有说如何覆盖?我尝试对 UITextField 进行分类,但没有成功。有人有想法吗? 谢谢
I want to create a UITextField with the placeholder aligned to left and the text is aligned to center. I search a bit and I found placeholderRectForBounds: function the apple documents says override if you want to but doesnt say how? I tried categorize the UITextField however It wasnt a success. any one has an idea?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下将文本对齐方式设置为左对齐。
当您开始在文本字段上输入内容时,将调用此委托
当您将焦点移出文本字段时,将调用此委托
At default set the text alignment as left.
When you start typing on the textfield this delegate will be called
This delegate will be called when you focus out of textfield