废话不多说了,直接给大家上关键代码了,具体代码如下所述: - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText // called when text changes (including clear){if (searchBar.text.length IMP
废话不多说了,直接给大家上关键代码了,具体代码如下所述:
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText // called when text changes (including clear) { if (searchBar.text.length > IMPUT_MAX){ searchBar.text = [searchBar.text substringToIndex:15]; } }
好了,到此结束,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的,在此页非常感谢大家对自由互联网站的支持!