- textField.placeholder = @"username is in here!";
- [textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
- [textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
这里是使用了KVC的方式
时间: 2024-12-05 21:10:48