I have cells that expand by changing their height with a setExpanded: method call.
I then call reloadRowsAtIndexPaths: to refresh the cells.
The problem is the c
@Javy,
Thanks for your question. I was developing table with similar behaviour: there are text views (UITextView
) in my table view cells (UITableViewCell
) that are :
So I found the same problem. In iOS 5.x when I was starting to type text it suddenly was becoming invisible. But in iOS 4.x everything works fine.
I have found the solution and it works well for me.
Solution: Just try to replace your animation type UITableViewRowAnimationAutomatic
with UITableViewRowAnimationNone
when reloading the particular cell.
Some additional code: reload both cell in one moment:
NSMutableArray *indexes = [NSMutableArray arrayWithCapacity:2];
// collapse previous cell
if( previousCell != nil && [previousCell expandable] )
{
if( [previousCell expanded] ) [previousCell setExpanded:NO];
[indexes addObject:previousIndexPath_];
}
// expand new cell
if( [cell expandable] )
{
[cell setExpanded:YES];
[indexes addObject:indexPath];
}
[tableView reloadRowsAtIndexPaths:indexes withRowAnimation:UITableViewRowAnimationNone];
Hope it will help you.