iOS textfield浅析

来源:互联网 发布:access2007数据库引擎 编辑:程序博客网 时间:2024/05/22 05:32
  1. 修改placeholder字体、颜色等,其实textfield的placeholder是一个UILabel,只要取出它的label,就可以设置,这里介绍一种KVC的方式
textField.placeholder = @"username is in here!";  [textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];  [textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
0 0
原创粉丝点击