Tag: 占位符

在UITextField中input时保持占位符静态

我想在input时保持占位符静止。 使用iOS的默认行为,只要我们开始在UITextFieldinput占位符消失,提前UITextField 。

为UITextfield占位符设置字体

我用下面的代码为UITextfield的文本(16)和占位符(9)设置不同的字体, m_searchTextField.font = UIFont .systemFontOfSize(16) let font = UIFont .systemFontOfSize(9) let attributes = [ NSForegroundColorAttributeName: UIColor.lightGrayColor(), NSFontAttributeName : font] m_searchTextField.attributedPlaceholder = NSAttributedString(string: "Search String be in meddle left", attributes:attributes) 字体大小设置正确,但占位符文本设置在文本字段中稍高。 我该如何解决这个问题? 有什么build议么?

UITextField在iOS中将占位符颜色设置为黑暗

我曾尝试将UITextField “占位符”颜色设置为黑暗。 NSAttributedString * search = [[NSAttributedString alloc] initWithString:@"Search" attributes:@{NSForegroundColorAttributeName: [UIColor blackColor]}]; textField.attributedPlaceholder = search; 但仍然在“占位符”中显示浅灰色的UITextField 。 是否有可能为UITextField设置黑暗的“占位符”颜色? 另外我也尝试了另一种方法 [textField setValue:[UIColor blackColor] forKeyPath:@"_placeholderLabel.textColor"]; 但是这两种方法都在iOS 7中工作,但不能在iOS 6上工作。 是否有可能在iOS 6目标UITextField设置黑暗的“占位符”颜色? 谢谢!

如何为设置包的文本字段提供占位符(Root.plist)

我想给设置包(Root.plist)的textfield的占位符是可能的? 如果是的话。 如果没有,那么iPhone怎么可能呢?

源文件中的Swift Editor占位符

嗨有问题的Swift编辑器占位符在源文件“这是我的代码 public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell{ let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: <#T##IndexPath#>) as! CustomBrandCell let brandImage: UIImage = UIImage(named: self.brands[indexPath.row].name)! cell.brandImageView.image = brandImage return cell }