开发者

How to change UITextField’s Placeholder color in objective C?

开发者 https://www.devze.com 2023-03-04 01:44 出处:网络
Now i am using the private method which is given below, [self.Textfield setValue:[UIColor darkGrayColor] forKeyPath:@\"_placeholderLabel.textColor”];

Now i am using the private method which is given below,

[self.Textfield setValue:[UIColor darkGrayColor] forKeyPath:@"_placeholderLabel.textColor”];

Please any help for the public method for the changing t开发者_StackOverflow中文版he Placeholder color.

Thanks in Advance.


Try:

(void) drawPlaceholderInRect:(CGRect)rect {
    [[UIColor blueColor] setFill];
    [[self placeholder] drawInRect:rect withFont:[UIFont systemFontOfSize:16]];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消