首页 > 移动平台 > 详细

iOS 修改textholder的颜色

时间:2014-04-03 10:56:02      阅读:604      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(10, 50, 320, 50)];
    textField.placeholder = @"填写订单";
    if ([textField respondsToSelector:@selector(setAttributedPlaceholder:)]) {
        UIColor *color = [UIColor redColor];
        textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"填写订单" 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.
    }
    [self.view addSubview:textField];
bubuko.com,布布扣

iOS 修改textholder的颜色,布布扣,bubuko.com

iOS 修改textholder的颜色

原文:http://www.cnblogs.com/lihaibo-Leao/p/3641563.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!