不需要那么麻煩,系統(tǒng)提供了API。
self.searchBar.enablesReturnKeyAutomatically = NO;
UISearchBar空數(shù)據(jù)時(shí)可點(diǎn)擊搜索按鈕searchBar 在沒(méi)數(shù)據(jù)時(shí),搜索按鈕是默認(rèn)被禁用的然而PM們的想法是無(wú)限的(你們懂的),遍歷下searchBar的子類們,找到那個(gè)textField,把enablesRe...
本文首發(fā)于我的個(gè)人博客:「程序員充電站」[https://itcharge.cn]文章鏈接:「?jìng)魉烷T」[https://itcharge.cn/ios-complete-le...