如何更改目标c占位符的颜色
问题描述:
我想更改目标c 中的UItextfield占位符颜色,但我的类是uiviewcontroller的子类。 我可以继承uiviewcontroller和uitextfield吗?如何更改目标c占位符的颜色
答
[self.Textfield setValue:[UIColor darkGrayColor] forKeyPath:@"_placeholderLabel.textColor”];
答
您可以使用波纹管代码
[yourtextfield setValue:[UIColor colorWithRed:120.0/255.0 green:116.0/255.0 blue:115.0/255.0 alpha:1.0] forKeyPath:@"_placeholderLabel.textColor"];
这是补救你的问题 [HTTP ://*.com/questions/1340224/iphone-uitextfield-change-placeholder-text-color] [1] [1]:http://*.com/questions/1340224/iphone-uitextfield-change-placeholder-text-color – Iducool 2012-07-19 08:08:39