3
votes

I have a UIViewController with a UIView subclass as a subview, and in here is a UITableView added as a subview of that UIView, as follows:

UIViewController
-UIView
--UITableView (plucked from a UITableViewController)

On an iPad, if I load the view controller in either orientation I can interact with the table view perfectly. However, if I rotate the device to a new orientation - I have code that alters the frames to make it fit the new resolution, but a small area of the table does not respond to touches and whatnot.

eg, we rotate portrait to landscape: if you imagine a portrait shape placed over a landscape screen - this area remains responsive, but a small strip to the right hand side does not respond.

Does anyone have any ideas what I may have missed? Thanks in advance.

EDIT: I have successfully verified the CGRect frames of all objects from the tableview cells through to the top UIViewController.

1
Do you online resize the UITableView but not the parent UIView maybe?Johannes Fahrenkrug
I have successfully NSLogged all frame bounds of the tableview in question through to the top UIViewController, and they match up. The table view is pulled from a UIViewController originally but this other VC is released - might the tableview still be looking for it's original owner?Luke
Hmmm... not entirely impossible. Why would you rip it from one VC to add it to another anyway? Doesn't sound like the most elegant solution :)Johannes Fahrenkrug
Of course you are absolutely correct - I'm tinkering with some files from cocoacontrols for an RSS reader for a universal app - it works great apart from this orientation issue on the iPad.Luke

1 Answers

0
votes

The area that looses its interaction must have fallen outside its superview's frame after rotation.

you can check that by setting tableView.clipSubviews = YES;

using this, will crop the tableview portion falling outside the superview.