2016-11-16 89 views
0

所以我有一些自定义背景的基本文本框,这是底部的一行,其余部分是透明的,但现在占位符不再显示。iOS文本字段不显示占位符文本

这些文本字段

enter image description here

和配置

enter image description here

+1

你看到你的故事板占位符? –

+0

尝试更改文本框的背景颜色 – Rajat

+0

@MarieDm不,我不能在xcode中看到它们 – Uffo

回答

0

我已经找到一个可行的解决方案,你需要选择输入并设置以下的用户定义的运行时属性

enter image description here

0

这是更好地做到这一点:

if ([self.textField respondsToSelector:@selector(setAttributedPlaceholder:)]) { 
    self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.textField.placeholder attributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]}]; 
} 
相关问题