- //第一種
- UIColor *color = [UIColor whiteColor];
- _userName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"用戶名" attributes:@{NSForegroundColorAttributeName: color}];
- //第二種
- [_userName setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];