iOS6.0之后提供的attributedPlaceholder属性
NSString*holderText =@"输入餐厅名称或者编号";
NSMutableAttributedString*placeholder = [[NSMutableAttributedStringalloc]initWithString:holderText];
[placeholderaddAttribute:NSForegroundColorAttributeName
value:[UIColorwhiteColor]
range:NSMakeRange(0, holderText.length)];
textFiled.attributedPlaceholder= placeholder;
网友评论