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.
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
.
You can use the plain old placeholder
property:
mySearchBar.placeholder = @"Foo!";
It can also be changed within Interface Builder:
您可以设置占位符属性
sBar.placeholder = @"Key in video title to search";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.