【问题标题】:Xcode UItextField TransparencyXcode UItextField 透明度
【发布时间】:2018-04-24 07:59:58
【问题描述】:

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

【问题讨论】:

    标签: storyboard uitextfield xcode9


    【解决方案1】:

    试试这个:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-01
      • 2011-06-03
      • 1970-01-01
      • 2014-01-05
      • 1970-01-01
      • 2013-06-05
      • 1970-01-01
      • 2020-07-12
      相关资源
      最近更新 更多