2

The UIs are basically the same but one is for the smaller iPhone screen and the other for the larger iPad screens (used to this post to create the iPad UI).

On the iPhone, everything works great.

On the iPad, my button is discoloured (XIB shows it blue, appears white on the iPad), my TextFields don't seem to be properly connected to my UIViewController (the iPad and iPhone XIB share the same controller) but the real problem is that the app only responds to touches to the top left half of the screen (haven't actually measured, but it's about the size of an iPhone). Note: The app is visibly full screen on the iPad.

With some testing, I've confirmed the following:

  • This is only an issue on my app since other apps are full screen and have no issues
  • If I move a widget (button/textview) to the left edge from the center and relaunch the app, the widget works fully. If I move it to the right edge, it doesn't respond to touch at all.

In the image below, the green box depicts the area to which the app widgets respond to touch.

In my General app settings, I have selected Universal and I have successfully created a .XIB file for the UI of my iPhone app (LoginPage~iphone.xib) and iPad (LoginPage~ipad.xib).

Using XCode 5.0.2.

EDIT: I just realized that I had this issue as well when I was programmatically creating the UI with a UITableViewController.

Image showing widgets only responding to touch within highlighted section

Community
  • 1
  • 1
Dulax
  • 553
  • 3
  • 20
  • Could it be that there is an invisible view over the area blocking touches? If a view responds to touch events then it will block anything underneath it from receiving touches. – Fogmeister Jan 08 '14 at 16:42
  • Did you implement a check wether the device is an iPhone or an iPad and chose the corresponding .xib accordingly? – Jasper Jan 08 '14 at 16:42
  • @JasperPol I read somewhere on stack that if you name it ~ipad that the correct one is selected. That seems to be the case here since my views are layed out different enough to tell them apart. It's just the screen isn't responding outside of that green box area. – Dulax Jan 08 '14 at 16:51
  • @Fogmeister My View hierarchy in the XIB is: View -> (ImageView, 4 TextView and Button) (the child elements are all at the same level) – Dulax Jan 08 '14 at 16:52

1 Answers1

1

Your UI content is most likely contained within another view that isn't being sized to the full screen on the iPad. It was probably sized appropriately for the iPhone screen and isn't being adjusted. You can probably see this if you give a background color to the view that contains those UI elements, or maybe it's parent possibly. If you're using auto layout, you'll want to put constraints that specify no gaps between that view and the superview's edges. If not using auto layout, you'll want to use the autoresizing (struts and springs) to specify that the view should stretch horizontally and vertically, and maintain a fixed distance from all 4 edges.

For the issue with some elements like text fields not appearing to be connected to the controller, maybe you don't have them hooked up in the xib. Right-click on the text fields and such in the xib and see if they show that they're connected. If not, connect them.

Gavin
  • 8,204
  • 3
  • 32
  • 42
  • In the side menu of XCode for my XIB, I have a "View". When I expand this View, I have the image, 4 textviews and button at the same level as children of the View. The View itself has its size set to "iPad Full Screen" which is why the view covers the whole screen. Is there something I'm doing wrong here? – Dulax Jan 08 '14 at 17:13