码迷,mamicode.com
首页 > 其他好文 > 详细

设置textfield的placeholder的字体和颜色

时间:2015-07-31 14:59:37      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:字体   颜色   placeholder   ios   textfield   


设置textfield的placeholder的字体和颜色

UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 30, 300, 150)];

    textField.placeholder = @"this is a textField";

    [textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];

    [textField setValue:[UIFont boldSystemFontOfSize:30] forKeyPath:@"_placeholderLabel.font"];

    textField.borderStyle = UITextBorderStyleRoundedRect;

    [self.view addSubview:textField];


版权声明:本文为博主原创文章,未经博主允许不得转载。

设置textfield的placeholder的字体和颜色

标签:字体   颜色   placeholder   ios   textfield   

原文地址:http://blog.csdn.net/lu_ca/article/details/47168729

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