Xcode UItextField 透明度

Xcode UItextField Transparency

我想出了如何使 UITextField 透明的方法,但我现在需要将占位符文本设为白色。这可能吗?预先感谢您的帮助!

试试这个:

UIColor *color = [UIColor whiteColor];
textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholderText attributes:@{NSForegroundColorAttributeName: color}];