Search code examples
uitableviewconstraintsautolayoutlandscape

Unresponsive area in UITableView in landscape orientation


I'm developing an iPad application where I have a screen with UITableView hosted on UIScrollView. UITableView's leading space and trailing space is being pinned to superview.

I'm using Autolayout in my project.

When this screen appearing in landscape mode or rotated to it all visible elements of UITableView being resized correctly. However area after x=768pt is being untouchable. It's definitely area because beginning of editable elements (text view and text field) are being touchable. I checked contentSize of table, it's being OK (1024 in my case). Also when I rotate iPad from landscape to portrait contentSize of table still stays landscape (1024). I tried solution from this topic: bug in UITableView layout after orientation change and it worked. Don't know if this is connected to my issue.

I tried to place regular view instead of my UITableView. On this view after rotation touch area was OK. However when I placed my table on this view right area still was unresponsive.

Table's property clipsToBounds set to YES so it seems that content is not becaming outside of UITableView.

Please point to what may cause this issue. Right now I'm completely out of ideas what may cause this.


Solution

  • I found a solution. The problem was in overriden method -(void)layoutSubviews in my custom cell. I simply forgot to call [super layoutSubviews] in it.

    Never forget to call [super layoutSubviews] in any non-standard view.

    Hope my solution will help someone not to waste hours on simple issue.