使用Userattributes更改UITextField的占位符文本颜色?

Has*_*214 10 objective-c uitextfield ios

我想从用户属性(界面构建器)更改Place holder颜色,因为我不想继承我的UITextfield等...我在互联网上搜索并发现这个"_placeholderLabel.textColor"是的,这样可以很好地编程 [self.tfEmail setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];但我想在它中使用它接口构建器中的用户属性.

Xei*_*han 23

尝试删除'_',

图片

适合我.

  • 您可以更改字体,您可以更改任何存在的属性.无需以编程方式执行此操作. (3认同)
  • 你们两个http://www.wannabegeek.com/?p=395 http://blog.gaeremynck.com/user-defined-runtime-attributes-in-ios/为你的知识. (2认同)