码迷,mamicode.com
首页 > 移动开发 > 详细

iOS学习-UITextField设置placeholder的颜色

时间:2015-01-05 12:42:14      阅读:101      评论:0      收藏:0      [点我收藏+]

标签:

UITextField *text = [[UITextField alloc] initWithFrame:CGRectMake(50, 200, 200, 40)];
text.borderStyle = UITextBorderStyleRoundedRect;
    
NSMutableAttributedString * attributedStr = [[NSMutableAttributedString alloc]initWithString:@"密码"];
[attributedStr addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0, attributedStr.length)];
text.attributedPlaceholder = attributedStr;
    
[self.view addSubview:text];

 

iOS学习-UITextField设置placeholder的颜色

标签:

原文地址:http://www.cnblogs.com/Zsmile/p/4202994.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!