UITextField set placeholderColor and UITextField set clearButton Image
Posted 十一岁的加重
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了UITextField set placeholderColor and UITextField set clearButton Image相关的知识,希望对你有一定的参考价值。
self.usernameTextField.tintColor = [UIColor whiteColor]; [self.usernameTextField setValue:UIColorFromRGBA(0xffffff, .6f) forKeyPath:@"_placeholderLabel.textColor"];
self.passwordTextField.tintColor = [UIColor whiteColor]; [self.passwordTextField setValue:UIColorFromRGBA(0xffffff, .6f) forKeyPath:@"_placeholderLabel.textColor"];
UIButton *pwdClearButton = [self.passwordTextField valueForKey:@"_clearButton"]; [pwdClearButton setImage:[UIImage imageNamed:@"login_icon_clear"] forState:UIControlStateNormal];
UIButton *userNameClearButton = [self.usernameTextField valueForKey:@"_clearButton"]; [userNameClearButton setImage:[UIImage imageNamed:@"login_icon_clear"] forState:UIControlStateNormal];
以上是关于UITextField set placeholderColor and UITextField set clearButton Image的主要内容,如果未能解决你的问题,请参考以下文章
在 UITextField 中右对齐 PlaceHolder 文本
UITextField PlaceHolder 颜色改变 Monotouch
代码笔记UITextField设置placeholder颜色
RunTime运行时在iOS中的应用之UITextField占位符placeholder