Iphone Developer
Iphone Developer

Reputation: 41

Part of the screen disabled in landscape mode on view-based iPad app

I am developing an iPad application with view-based template in landscape mode as it has to share a toolbar to all its views and provide the functionality similar to tabbar.

The problem is that any control added to a portion of the screen on the right side is disabled. For example, if a button is added, the part of it on that portion of the screen doesn't work.

Surprisingly, the width of that portion of the screen is equal to the width of the screen in landscape subtracted by the width of the screen in portrait so I think the problem has something to do with that.

Thanks in advance

Upvotes: 1

Views: 117

Answers (1)

davehayden
davehayden

Reputation: 3484

I'm betting those controls are outside the bounds of their superview (or the superview's superview, or the super-super-superview, or…). When the view hierarchy does a hit test, it returns nil if the point is outside its frame, so subviews outside the frame can't be hit. Note that views in IB don't have the "clips subviews" option on by default, so it's hard to tell where the view bounds are. Also check the autoresize settings on those views--if one of the containing views isn't set to resize horizontally and it's sized to portrait width in the nib, it won't expand to landscape width when you rotate the device.

Upvotes: 1

Related Questions