My application uses an UITextView
. Now I want the UITextView
to have a placeholder similar to the one you can set for an UITextField
.<
What you can do is set up the text view with some initial value in the text
property, and change the textColor
to [UIColor grayColor]
or something similar. Then, whenever the text view becomes editable, clear the text and present a cursor, and if the text field is ever empty again, put your placeholder text back. Change the color to [UIColor blackColor]
as appropriate.
It's not exactly the same as the placeholder functionality in a UITextField, but it's close.