Reputation: 302
HI I develop an application in IOS and I meet a problem that I want to change the default text which is "search" in search bar to "Key in video title to search". How to do it ? Please help me Thank you.
Upvotes: 2
Views: 4071
Reputation: 1472
The UISearchBar
and the UITextField
have this property of a placeholder
which is the default text in the fields.
1.Change it from the Interface Builder.
2.Change it through code
self.searchBarObject.placeholder = @"Key In Video Title To Search";
Read what Apple has written about the UISearchField
.
Upvotes: 9
Reputation: 6445
You can set the placeholder property
sBar.placeholder = @"Key in video title to search";
Upvotes: 2
Reputation: 25697
You can use the plain old placeholder
property:
mySearchBar.placeholder = @"Foo!";
It can also be changed within Interface Builder:
Upvotes: 2