0

好吧,我读了这篇文章,但是范围栏只是立即显示,没有动画。

4

1 回答 1

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 委托。

于 2012-07-05T08:31:08.033 回答