ios修改textField的placeholder的字体颜色、
2016-06-30 本文已影响391人
GreenB
方法1:
cell.textFiled.attributedPlaceholder= [[NSAttributedString alloc]initWithString:@"Placeholder"attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
方法2:
textField.placeholder=@"placeholder";
[textField setValue:[UIColor redColor]forKeyPath:@"_placeholderLabel.textColor"];
[textField setValue:[UIFont boldSystemFontOfSize:16]forKeyPath:@"_placeholderLabel.font"];