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];

最新文章

  1. 【codevs1163】访问艺术馆
  2. 【原创】Windows Server 文件夹权限小问题
  3. 【读书笔记】读《JavaScript设计模式》之门面模式
  4. wampserver,eclipse,PHPeclipse搭建php开发环境
  5. [Ubuntu] Ubuntu搭建VPN服务器pptpd
  6. Oracle 序列(sequence)
  7. Mac OS X 快捷键(完整篇)
  8. 使用Vitamio打造自己的Android万能播放器(7)——在线播放(下载视频)
  9. MySQL分区表基础
  10. c/c++(hiredis)异步调用redis【转】
  11. 七牛云图片的存储与处理--基于node
  12. php Warning: require(): open_basedir restriction in effect File(/www/wwwroot/default/
  13. .NET CORE 实践(3)--Visual Studio 2015 Update 3更新之后DotNetCore.1.0.1-VS2015Tools.Preview2.0.2.exe无法正确安装
  14. Constructor in depth
  15. linux内核完全剖析——基于0.12内核-笔记(2)-统一编址和独立编址
  16. 32bit 天堂2脚本修改资料大全【客户端+服务端】
  17. P1020 导弹拦截 dp 树状数组维护最长升序列
  18. 关于有些.aidl源码的eclipse编译后生成.java文件的错
  19. MySQL---7、常用操作
  20. 洛谷 P2530 [SHOI2001]化工厂装箱员 解题报告

热门文章

  1. leetcode-【中等题】2. Add Two Numbers
  2. Hibernate单元测试工具junit
  3. Flask-RESTful 快速入门
  4. qsort库函数的用法
  5. 数据库FMDB-sql
  6. python Tab自动补全命令设置
  7. Linux终端下安装jdk
  8. <a>标签中的href="javascript:;"是什么意思?
  9. Express安装过程
  10. DNS服务器原理