占位符的字体的颜色,大小设置。
UITextField *textField = [[UITextField alloc] init];
UIFont *font = [UIFont systemFontOfSize:12];
UIColor *color =[UIColor whiteColor];
textField.textAlignment = NSTextAlignmentCenter;
// 没错,就是看接下来这一步了。
textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"设置颜色和大小" attributes:@{NSFontAttributeName:font, NSForegroundColorAttributeName:color}];