时间:2022-01-04 10:56:57 | 栏目:iOS代码 | 点击:次
废话不多说了,直接给大家上关键代码了,具体代码如下所述:
- (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]; } }