IOS 开发更改UITextField的Placeholder颜色

时间:2014-07-12 16:16:01   收藏:0   阅读:225

      

    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100, 200, 200, 40)];    UIColor *color = [UIColor redColor];

    textField.backgroundColor = [UIColor yellowColor];

    

    textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"密码" attributes:@{NSForegroundColorAttributeName: color}];

    

    [self.view addSubview:textField];

 

  来自 http://code4app.com/snippets/one/UITextField设置placeholder颜色/537c765e933bf0a0468b525c#s0

     

IOS 开发更改UITextField的Placeholder颜色,布布扣,bubuko.com

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!