我使用下面的代碼來顯示帶有範圍欄的UISearchBar
。UISearchBar不顯示範圍欄
UISearchBar *searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 320, 45)];
searchBar.barStyle = UIBarStyleDefault;
searchBar.showsCancelButton = NO;
searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone;
searchBar.scopeButtonTitles = [NSArray arrayWithObjects:@"One", @"Two", nil];
searchBar.showsScopeBar = YES;
self.tableView.tableHeaderView = searchBar;
[searchBar release];
但是,範圍欄從不顯示。爲什麼沒有顯示,我該如何解決這個問題?
非常感謝!很簡單。 – Joshua 2010-08-28 14:32:56