开发者

UITableView portion loses interaction after device rotation

开发者 https://www.devze.com 2023-04-13 07:18 出处:网络
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:

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.


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.

0

精彩评论

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