UITableViewCell wrong width on iPad

We have a modal view that contains a table view that contains the UITableViewCells used to edit the item. Everything works fine on the iPhone, but on the iPad we cannot force the UITableViewCell to register as anything but 320 pixels wide. It will be displayed mostly correctly, but the elements inside the cell are aligned, as if they were only 320 pixels wide, and anything outside of 320 pixels does not respond to any touch events.

I raised the hierarchy of views to see if it is possible that the view got stuck at 320 px, which can make the table view cell think about its only 320 pixels wide, but we cannot find anything.

We also even tried to present the modal view in the main window to make sure it was presented at the highest level:

[appDelegate.tabBarController presentModalViewController:myEditor animated:YES]; 

I checked the tabBarController framework, the myEditor view controller and everything else, and they all seem to be correct. The only problem seems to be tableview cells.

Any help would be greatly appreciated. Thanks!

+4
source share
1 answer

We found that the best way to do this is to subclass the cell and override layoutSubviews (and remember to include [super layoutSubviews] ). This usually works in most situations.

+2
source

All Articles