iphone ipad 更改文本字段颜色
请问,如何更改文本字段背景的颜色和占位符的颜色? 我看到这个答案
[UIColor colorWithRed:0.2f green:0.3f blue:0.4f alpha:0.50001f];
我应该覆盖 UITextField.h 吗?在哪里? 或者我应该在哪里改变颜色?
并更改占位符,但它不起作用! 堆栈,更改支架。
please, how can I change the color of the text field background and the colour of place holder?
I saw this answer
here in stack, change bkgrnd
but Is not clear where to call this
[UIColor colorWithRed:0.2f green:0.3f blue:0.4f alpha:0.50001f];
shall I override the UITextField.h? where?
or where shall I change the colour?
and for the changing of the place holder, but it doesn't work!
stack, change holder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以覆盖 UITextField 并在 init 方法中执行此操作。但我强烈建议您在创建 UITextField 之后进行操作
You can overwrite UITextField and do this in the init method. But I would highly recommend to do simply after you created your UITextField
要更改文本字段的背景:
要更改占位符文本颜色:
To change the background of your textfield :
To change the placeholder text color :