Reputation: 10159
I have a UITableView full of custom draw cells. When the view rotates, it just stretches all my custom drawing. How can I get my views to redraw themselves when the view rotates?
Upvotes: 1
Views: 872
Reputation: 10159
My solution was to override like willAnimateRotationToInterfaceOrientation:duration: so:
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
{
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
}
Of coarse, this only works in 3.0 and you would need to reload all of your sections if you had more than one.
Upvotes: 0