UITearchView를 UITableView.tableHeaderView에 배치했습니다. 그러나 첫 번째 섹션 헤더에 볼 수있는 맨 위를 배치하여 searchBar를 덮습니다. 나는 tableBar를 드래그 할 때만 searchBar를 볼 수 있습니다. 반은 덮어서 tableView 스크롤을 놓으면 다시 볼 수 없게 될 것이기 때문에 선택할 수 없습니다. 도와주세요. UISearchBar가 tableViewHeader로 덮여 있습니다.
다음
내있는 UITableViewController있는 viewDidLoad 방법에 배치됩니다 :UISearchBar *theSearchBar = [[UISearchBar alloc] init];
theSearchBar.delegate = self;
self.searchBar = theSearchBar;
[theSearchBar release];
self.tableView.tableHeaderView = self.searchBar;
결과는 다음 스크린 샷입니다 : http://imagebin.ca/view/6qNiwHR.html
정말 고마워요. 심지어 컨트롤러가 있다는 것을 깨닫지 못했습니다. 이제 이걸 시험해 볼거야. – Sukima
적어도 3.0 이후로'searchDisplayController'는 읽기 전용 속성이므로이 방법으로 설정할 수 없습니다. –