2012-07-05 56 views

回答

0

這應該工作:

- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar { 
    [searchBar setShowsCancelButton:YES animated:YES]; 
    searchBar.showsScopeBar = YES; 
    return YES; 
    } 

    - (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar { 
    [searchBar setShowsCancelButton:NO animated:YES]; 
    [searchBar sizeToFit]; 
    searchBar.showsScopeBar = NO; 
    return YES; 
    } 

記得到的UISearchBar委託關聯。

+0

嗯,這個應該是動畫範圍吧? –

+0

我編輯了我的答案,它應該。 – self

+2

這顯示了範圍欄,但不爲我製作動畫。 –