UITextField 的Placeholder的字体的颜色大小
2016-05-16 13:57
381 查看
设置UITextField的placeholder的颜色代码片段:
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 200, 200)]; NSString *holderText = @"标哥的技术博客"; NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:holderText]; [placeholder addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0, holderText.length)]; [placeholder addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:16] range:NSMakeRange(0, holderText.length)]; textField.attributedPlaceholder = placeholder; [cell.contentView addSubview:textField];
相关文章推荐
- 21: Arithmetic Sequence--HZAU(dp)
- UITableView Section标题不滑动问题
- Android学习笔记——AlertDialogbuilder和AlertDialog
- 【Arduino官方教程第一辑】示例程序 4-6 串口控制LED
- HBuilder的常用快捷键
- STL 整理(map、set、vector、list、stack、queue、deque、priority_queue)zhuanzai
- 用 QueryPerformanceFrequency 和 QueryPerformanceCounter 进行高精度计时
- PAT (Advanced Level) 1017. Queueing at Bank (25)
- poj 2524 Ubiquitous Religions(宗教信仰)
- 使用RTEMS Source Builder 编译RTEMS-4.11的开发工具链
- 【转】Android中的IOC框架,完全注解方式就可以进行UI绑定和事件绑定
- 排序——quickSort
- 【ROS】Choosing a queue_size - queue_size的大小的设置
- SPOJ375 Query on a tree
- 使用Jenkins+xcodebuild搭建iOS的持续集成系统
- UI基础_hitTest扩大响应范围
- 连接数据库超时设置autoReconnect=true
- SurfaceFlinger sequence diagram
- HZAU--21--Arithmetic Sequence(二维dp)
- iOSUIView是否包含,相交