IOS 修改textFiled palceholder 颜色

iOS6.0之后提供的attributedPlaceholder属性

NSString*holderText =@"输入餐厅名称或者编号";

NSMutableAttributedString*placeholder = [[NSMutableAttributedStringalloc]initWithString:holderText];

[placeholderaddAttribute:NSForegroundColorAttributeName

value:[UIColorwhiteColor]

range:NSMakeRange(0, holderText.length)];

textFiled.attributedPlaceholder= placeholder;

你可能感兴趣的:(IOS 修改textFiled palceholder 颜色)