我正在嘗試實施UISearch欄,但我遇到了一些問題。 當應用程序啓動我添加表視圖這樣的:添加UISearch欄時出現問題
ChannelTableViewRootController *firstViewController = [[ChannelTableViewRootController alloc] initWithStyle:UITableViewStylePlain];
navigationController = [[UINavigationController alloc]initWithRootViewController:firstViewController];
navigationController.navigationBar.hidden = NO;
UIView *uv = self.view;
[uv addSubview:[navigationController view]];
我在廈門國際銀行補充UISearch吧。將它連接到我的頭文件中的UISearchBar變量。設置委託給自己,並嘗試將它添加到頭部的tableview的:
self.tableView.tableHeaderView = searchBar;
searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
當我做對象手動「searchBar = [[UISearchBar alloc]init]; // + code from above
」我得到了顯示的搜索欄像圖像,但沒有happends,不能把它在這頭。我正在嘗試使用示波器等在地址簿中進行搜索。
謝謝,現在它看起來更好,該教程是很大的。我連接所有的應用程序,它的工作,但只有一件事是失蹤。在地址簿應用程序中,當用戶點擊搜索文本框時,搜索框會在標題中出現,並在搜索框下方出現可搜索的文件夾列表。這就是所謂的範圍或者什麼,關於如何產生這種效果的任何建議? – 1110 2011-01-11 12:05:10