//首先设置textField的placeholder文字
textField.placeholder = @"设置textField的placeholder文字";
//在设置他的字体颜色
[textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
//最后设置他的字体大小
[textField setValue:[UIFontboldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
//创建一个textField
UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 200, 30)];
//设置textField的placeholder文字
NSString *holderText = @"设置textField的placeholder文字";//创建NSMutableAttributedString
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc]initWithString:holderText];
//在设置他的字体颜色
[placeholderaddAttribute:NSForegroundColorAttributeNamevalue:[UIColor redColor]
range:NSMakeRange(0, holderText.length)];
//最后设置他的字体大小
[placeholderaddAttribute:NSFontAttributeName
value:[UIFontboldSystemFontOfSize:16]
range:NSMakeRange(0, holderText.length)];
textField.attributedPlaceholder = placeholder;
[cell.contentViewaddSubview:textField];