Tengo un UITableView con una UISearchBar en la parte superior.iPhone UITableView con UISearchBar y el refrescante índice de sección
También uso el delegado de Section Index para mostrar ABC ... XYZ en el lado derecho.
problema se produce cuando hago clic en el cuadro de búsqueda y el teclado viene desde el fondo, las calabazas Sección Índice de modo que sólo una D ... * Z se visualizan - cuando cierro la búsqueda y el teclado desaparece , el índice permanece en este estado "aplastado" hasta que me desplazo o similar.
// 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];
Mis preguntas son, ¿Alguien ha visto este comportamiento? ¿Hay alguna manera de volver a dibujar el índice de la sección en el RHS ([[self tableView] reloadData]
no hace el truco)
¡Gracias un millón!
He editado mi post anterior para mostrar el código exacto que estoy usando ... en vano! – adam