iOS开发-UI控件:修改textField的placeholder的字体颜色、大小

来源:互联网 发布:aliasstudio软件下载 编辑:程序博客网 时间:2024/06/15 06:07

原文转自: http://blog.csdn.net/woaifen3344/article/details/38352015

[objc] view plaincopyprint?在CODE上查看代码片派生到我的代码片
  1. textField.placeholder = @"username is in here!";  
  2. [textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];  
  3. [textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];  
这里是使用了KVC的方式,是不是很简单呢?呵呵

0 0