开发者

UITableViewCell incorrect width on iPad

We have a modal view that contains a Table view that contains UITableViewCells used to edit an item. On the iPhone everything works fine, but on the iPad we're unable to get the UITableViewCell to register as anything besides 320 px wide. It will basically display correctly, but the items inside of the cell align as if it were only 320 px wide, and anything outside of 320 pixels does not respond to any touch events.

I've gone up the view hierarchy to see if possibly there is a view stuck at 320 px that might be forcing the table view cell to think its only 320 pixels wide, but we can't find anything.

We also even tried presenting the modal v开发者_开发技巧iew in the main window to ensure it was presented at the highest level:

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

I've checked the frame of the tabBarController, the "myEditor" view controller, and everything else involved and they all seem to be correct. The only issue seems to be the tableview cells.

Any help would be greatly appreciated. Thanks!


We found the best way to do this is to subclass the cell and override layoutSubviews (and remember to include [super layoutSubviews]). This has seemed to generally work in most situations.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜