Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change placeholder text color in xib?

Tags:

How to change placeholder text color in xib ? I have tried key path thing but it is giving me NSException. Can anyone please help.

like image 848
goCode Avatar asked Apr 25 '14 05:04

goCode


People also ask

How do I change the placeholder color in UITextField in IOS Swift?

Create UITextField Extension like this: extension UITextField{ @IBInspectable var placeHolderColor: UIColor? { get { return self. placeHolderColor } set { self. attributedPlaceholder = NSAttributedString(string:self.

How do I change the color of a TextField in Swift?

Just use . foregroundColor to change the text color of a TextField in SwiftUI.


1 Answers

The easiest method to modify the placeholder text color is through the Xcode storyboard interface builder. Select the UITextField of interest and open the identity inspector on the right. Click on the plus symbol in the User Defined Runtime Attributes and add a new row with Key Path as placeholderLabel.textColor, Type as Color and Value to your desired color.

like image 122
Navneil Naicker Avatar answered Sep 21 '22 20:09

Navneil Naicker