修改placeholder的字体颜色
2016-06-12 17:05
260 查看
第一种
UIColor *color = [UIColor whiteColor];
_userName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"用户名" attributes:@{NSForegroundColorAttributeName: color}];
第二种
[_userName setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
UIColor *color = [UIColor whiteColor];
_userName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"用户名" attributes:@{NSForegroundColorAttributeName: color}];
第二种
[_userName setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
相关文章推荐
- jsp+javaBean开发计算器案例
- Java语言设计文本查找器和文本编辑器
- java设计模式-单例模式
- Nginx安装过程
- hjr-PHP:PHP环境搭建
- IO多路复用--select、 poll、 epoll的区别
- Android批量打包
- React Native 植入原生应用
- /usr/bin/ld: cannot find -lpython2
- OC 局部变量 成员变量 属性及方法 OC成员变量的私有性
- js到底是个啥?
- 关于iOS通话记录的问题
- 回溯算法----简单练习全排列
- elipse修改编码格式
- Android中ListView嵌套导致高度错误
- c++中用new和不用new创建对象的本质区别
- Linux Apache+Tomcat 整合(JK方式)
- JavaScript中实现键值对应的字典与哈希表结构的示例
- lambda表达式
- redis通过命令批量删除key