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