Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad landscape-only app not responding to touches near the bottom of the screen

I’m an experienced developer, but relatively new to iOS.

I’m having some trouble with an iPad App, where my views are not responding to button touches in the bottom third of the screen. Touches on other buttons are working fine, so I know my views are getting hooked up properly when they’re loaded (I’ve created them in IB.) I get the same behavior on both the simulator and the device.

This is a landscape-orientation-only App, and I’m loading views using [NSBundle LoadNibNamed:]. This was the only non-trivial portion of the App, and I think I’ve jumped through all the appropriate hoops:

  • Added Initial Interface Orientation line to my .plist
  • Designed my views in Landscape orientation in IB
  • Added shouldAutoRotateToInterfaceOrientation to my top-level view that only return YES for landscape orientations

The landscape orientation may not be related, but I thought I should mention it, since it was the only thing I found a little wonky to build, and I see from the boards that other people have found this problematic as well..

Does anyone have any ideas?

Thanks.

like image 277
AndrewCr Avatar asked Oct 14 '22 01:10

AndrewCr


1 Answers

More than likely, your autoresizing masks are not set correctly. This means that the view's bounds are not changing to match the window. Touches are only detected within the bounds of a view's super view, so if you have a button that sits outside its superview's bounds, it won't get any touches.

For a quick test, try setting your view's background color and see if the view does properly extend to the bottom of the screen.

like image 110
David Liu Avatar answered Oct 20 '22 17:10

David Liu