简单实现修改UITextField的placeholder字体颜色&大小
修改字体颜色
UITextField * textField = [[UITextField alloc] init];
NSString *testText = @"这是测试字段";
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString: testText];
[placeholder addAttribute:NSForegroundColorAttributeName
value:[UIColor redColor]
range:NSMakeRange(0, testText.length)];
[placeholder addAttribute:NSFontAttributeName
value:[UIFont boldSystemFontOfSize:14]
range:NSMakeRange(0, testText.length)];
textField.attributedPlaceholder = placeholder;
干货就是这么简单,点个赞再走呀亲!!!