Does anyone know what color a UITextField
's placeholder text is, by default? I'm trying to set a UITextView
's text to the same color. I've read elsewhere that it is UIColor.lightGrayColor()
but it is actually a little lighter.
Note: In most browsers, the appearance of placeholder text is a translucent or light gray color by default.
You can set the placeholder text using an attributed string. Just pass the color you want to the attributes parameter.
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.
Type placeholders is a new language feature introduced in Swift 5.6 (Xcode 13.3). The concept is straightforward. Type placeholders allow us to write types with type placeholders ( _ ) which directs the compiler to infer the type where _ is used.
The colour is #C7C7CD (r: 199 g:199 b: 205) (as what pterry26 said)
and the font-family is HelveticaNeue-Medium and size is 16
Note that this is a guess at what the color looks like on a screen. For the actual values, simply inspect the Apple code for attributedPlaceholder
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With