I have a custom UITableViewCell which contains several UIButtons. Each button\'s frame position is relative to the cell width. I set autoresizingMask=UIViewAutoresizingFlexi
I had a similar problem and this post helped me. In my case I have a custom class declared in a separate file, and in this file I have the following code in layoutSubviews
:
//PORTRAIT CELL
if ([UIDevice currentDevice].orientation!=UIDeviceOrientationLandscapeLeft &&
[UIDevice currentDevice].orientation!=UIDeviceOrientationLandscapeRight)
{
//build the custom content views for portrait mode here
}
else
{
//build the custom content views for landscape mode here
}
Then in my view controller I just implement willAnimateRotationToInterfaceOrientation:
and send the reloadData
message to my table view.
With this I don't have to touch the cellForRow
method.