改变UITextField的Placeholder颜色
2015-09-18 14:33
399 查看
通过 attributedPlaceholder 属性来改变
原文:http://www.cnblogs.com/kingW/p/3730206.html
if([textField respondsToSelector:@selector(setAttributedPlaceholder:)] { UIColor*color =[UIColor blackColor]; textField.attributedPlaceholder =[[NSAttributedString alloc] initWithString:placeholderText attributes:@{NSForegroundColorAttributeName: color}]; }else{ NSLog(@"Cannot set placeholder text's color, because deployment target is earlier than iOS 6.0"); // TODO: Add fall-back code to set placeholder color. }
原文:http://www.cnblogs.com/kingW/p/3730206.html
相关文章推荐
- 加载SpriteBuilder中的scene为何不能带后缀
- 加载SpriteBuilder中的scene为何不能带后缀
- 加载SpriteBuilder中的scene为何不能带后缀
- UITableview控件基本使用
- mosquitto-1.4.2安装配置教程
- JSONValue.parse出错
- win7 64位系统下运行Jbuilder2006
- iOS学习笔记—— UINavigationController(一)实现页面跳转&添加左右侧按钮
- this compilation unit is not on the build path of a java project
- android ui分析 - 今日头条UI主界面
- 猫学习IOS(十五)UI以前的热的打砖块游戏
- HDU5400 Arithmetic Sequence
- Implement Stack using Queues
- xcode7.0-iOS9新特性之三:界面适配利器:UIStackView
- UITabBarItem 如何触发点击事件
- 【Mockplus教程】重命名
- 【Mockplus教程】删除
- 【Mockplus教程】复制/克隆
- 关机时windows发的消息WM_QUERYENDSESSION
- 【Mockplus教程】收藏和重用