Add placeholder text inside UITextView in Swift?

How can I add a placeholder in a UITextView, similar to the one you can set for UITextField, in Swift? 44 Answers 44 Updated for Swift 4 UITextView doesn’t inherently have a placeholder property so you’d have to create and manipulate one programmatically using UITextViewDelegate methods. I recommend using either solution #1 or #2 below … Read more

How do I make a placeholder for a ‘select’ box?

I’m using placeholders for text inputs which is working out just fine. But I’d like to use a placeholder for my selectboxes as well. Of course I can just use this code: <select> <option value=””>Select your option</option> <option value=”hurr”>Durr</option> </select> But the ‘Select your option’ is in black instead of lightgrey. So my solution could … Read more

Change a HTML5 input’s placeholder color with CSS

Chrome supports the placeholder attribute on input[type=text] elements (others probably do too). But the following CSS doesn’t do anything to the placeholder’s value: input[placeholder], [placeholder], *[placeholder] { color: red !important; } <input type=”text” placeholder=”Value”> But Value will still remain grey instead of red. Is there a way to change the color of the placeholder text? … Read more