Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the default color for placeholder text in UITextField?

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.

like image 565
pterry26 Avatar asked Jun 25 '15 18:06

pterry26


People also ask

What is the default placeholder color?

Note: In most browsers, the appearance of placeholder text is a translucent or light gray color by default.

How do I change placeholder color in Swift?

You can set the placeholder text using an attributed string. Just pass the color you want to the attributes parameter.

How do I change the placeholder color on a storyboard?

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.

What is placeholder in Swift?

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.


1 Answers

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.

like image 169
Daniel Fernandes Avatar answered Sep 30 '22 08:09

Daniel Fernandes