2016-11-16 87 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]}]; 
} 
相關問題