[iOS]UITextField修改Placeholder颜色

2021-03-19  本文已影响0人  汴城码农
    self.usernameTextField.tintColor = [UIColor blackColor];
    NSDictionary *attrs = @{NSForegroundColorAttributeName: UIColorFromRGBA(0xffffff, .6f)};
    self.usernameTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入帐号".ntes_localized attributes:attrs];
    self.passwordTextField.tintColor = [UIColor blackColor];
    self.passwordTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入密码".ntes_localized attributes:attrs];
上一篇 下一篇

猜你喜欢

热点阅读