Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set helper grey text for UISearchBar

How can i set a default text in the search bar that looks grey so that it may hint what you could search before the user touches the search bar so that he may write something?

For example, i could have "Search for coffee shops or restaurants" and when i touch the UISearchBar the text dissapears ?

like image 298
Alex Avatar asked Sep 16 '11 11:09

Alex


1 Answers

Try Placeholder property of UISearchBar...and set it as Search for coffee shops or restaurants

Happy coding..

like image 135
Mehul Mistri Avatar answered Sep 27 '22 17:09

Mehul Mistri