如何用swift代码修改ios里text field 里注释文字的颜色深浅 现在的自带文字看不清楚
ringa_lee
You can try this:
[textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
But obviously this method is not publicly supported, so it may not be effective in future versions of iOS. To be safe, don't use the default placeHolder, write a label yourself and put it there.
You can try this:
But obviously this method is not publicly supported, so it may not be effective in future versions of iOS. To be safe, don't use the default placeHolder, write a label yourself and put it there.