상단에 UISearchBar가있는 UITableView가 있습니다.iPhone UITearchView와 UISearchBar 및 새로 고침 섹션 색인
또한 섹션 인덱스 대리인을 사용하여 오른쪽에 ABC ... XYZ를 표시합니다. 내가 검색 상자를 클릭하고 키보드가 바닥에서 올라 오는
문제, 섹션 인덱스 과즙 그렇게 만 D이 ... * Z가 표시되어 발생 - 나는 검색을 닫고 그들은 키보드가 사라질 때 , 스크롤 할 때까지 색인이 "squashed"상태로 유지됩니다.
// animate the searchbar
[UIView beginAnimations:nil context:NULL];
CGRect tempRect = [[self searchBar] frame];
tempRect.size.width = 320-kMarginRight;
[[self searchBar] setFrame:tempRect];
[UIView commitAnimations];
// animate the search index back into view
for (UIView *view in [[self tableView] subviews]) {
if ([view respondsToSelector:@selector(moveIndexIn)]) {
MovableTableViewIndex *index = (MovableTableViewIndex*)view;
[index moveIndexIn];
}
}
// try a whole load of stuff to try and get the section indexes to draw again properly
// none of which work!
[searchBar setText:@""];
[searchBar resignFirstResponder];
letUserSelectRow = YES;
searching = NO;
[[self navigationItem] setRightBarButtonItem:nil];
[[self tableView] setScrollEnabled:YES];
[[self tableView] reloadData];
[[self tableView] flashScrollIndicators];
[[self tableView] sizeToFit];
[[self tableView] zoomScale];
[[self tableView] reloadSectionIndexTitles];
내 질문에 대한 답변을 드리겠습니다. RHS에서 섹션 인덱스를 다시 그리는 방법이 있습니까 ([[self tableView] reloadData]
은 트릭을하지 않습니다)
감사합니다.
은 내가 사용하고있는 정확한 코드 ... 아무 소용이 보여 내 위의 게시물을 편집했습니다! – adam