美文网首页iOS自我学习库
ios修改textField的placeholder的字体颜色、

ios修改textField的placeholder的字体颜色、

作者: GreenB | 来源:发表于2016-06-30 15:02 被阅读391次

方法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"];

相关文章

网友评论

    本文标题:ios修改textField的placeholder的字体颜色、

    本文链接:https://www.haomeiwen.com/subject/vmxfjttx.html