views:

76

answers:

1

I have subclassed UITableViewCell to make a custom cell for a tableView. I add text and images to the cell's contentView.

Everything looks great in landscape mode (iPad), but no so much when I rotate to portrait. Where is the best place to handle orientation changes so that all the table cells can reposition the contents in its contentView? Do I put this code in the TableViewController or in the UITableViewCell subclass?

A: 

You can play with autoresizingMask of your cell's views to see that maybe the proper result can be achieved automatically. If that doesn't work out, in your tableView's willAnimateRotationToInterfaceOrientation you can do:

NSArray* visibleCells = [tableView indexPathsForVisibleRows];
[self.tableView reloadRowsAtIndexPaths:visibleCells withRowAnimation:NO];
SVD