textFiled的placeHolder字体颜色
2016-06-27 14:15
155 查看
self.title=@"修改UITextField的placeholder字体颜色";
UITextField *textTF=[[UITextField alloc]initWithFrame:CGRectMake(20,130,300,30)];
textTF.placeholder=@"修改UITextField的placeholder字体颜色";
// // 一种方式
// [textTF setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
// 第二种方式
textTF.attributedPlaceholder=[[NSAttributedString alloc]initWithString:@"修改UITextField的placeholder字体颜色" attributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];
[self.view addSubview:textTF];
UITextField *textTF=[[UITextField alloc]initWithFrame:CGRectMake(20,130,300,30)];
textTF.placeholder=@"修改UITextField的placeholder字体颜色";
// // 一种方式
// [textTF setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
// 第二种方式
textTF.attributedPlaceholder=[[NSAttributedString alloc]initWithString:@"修改UITextField的placeholder字体颜色" attributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];
[self.view addSubview:textTF];
相关文章推荐
- 对web上的所有超文本引用进行正则表达式匹配
- iOS通知传值
- 关于zabbix_get 的介绍
- android中fragment的4个小问题
- 关于Android 开发中的一些命名规范
- iOS如何生成.a文件
- 当使用PHP use 关键词时
- java 8的十大新特性分析
- Java如何调用C++ DLL库
- RESTful思想
- think in java笔记 upcasting
- Spring 4.x官方参考文档中文版——第21章 Web MVC框架(15)
- 解决ie8不支持placeholder方法
- android AsyncTask的使用介绍
- 重定向
- 世界名曲
- QQ登录
- linux网络编程常用头文件
- Web Forms vs Web MVC
- 為什麼比 GIT 更好--理解 Mercurial 版本管理系統