How to change UITextFields color placeholder in a C object?

Now I use the private method, which is given below,

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

Get help from the Placeholder public color change method.

Thanks at Advance.

+3
source share
1 answer

Try:

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

All Articles