4
只要-[UISearchBar scopeButtonTitles]
不是nil
,無論我是否設置了showsScopeBar
到YES
或NO
,搜索欄都會顯示其範圍欄。這是一個錯誤還是我做錯了什麼?爲什麼忽略了[UISearchBar showsScopeBar]?
只要-[UISearchBar scopeButtonTitles]
不是nil
,無論我是否設置了showsScopeBar
到YES
或NO
,搜索欄都會顯示其範圍欄。這是一個錯誤還是我做錯了什麼?爲什麼忽略了[UISearchBar showsScopeBar]?
您需要的scopeButtonTitles
屬性設置爲nil
隱藏範圍吧:
searchbar.scopeButtonTitles = nil;
好像對我的錯誤。它只是在將我的故事板從AutoLayout切換到之前的佈局方法後才顯示出來。隨着AutoLayout的開啓,它將隱藏它。有了它,它顯示了它,我必須將它們設置爲零。 – iwasrobbed