25

I'm trying to modify an app to work with the new iPhone 5, 4" screen. I've added the new launch image, "Default-568h@2x.png". After that everything seemed good. Middle portion of my views is resizing ok.

However I've noticed that in a view where I have a bottom toolbar, the buttons on the toolbar are unresponsive. It looks ok, but tapping buttons does nothing. Same code run in simulator with 3.5" screen works fine.

Any ideas?

This view is within a navigation controller. It consists of a table view and toolbar. The tableview is set to resize height.

David
  • 2,770
  • 5
  • 35
  • 43
  • Did you inspect the frames of the toolbar and its superview? One scenario where this happens is if the child view lies outside the bounds of its container superview. The child view (or the toolbar in your case) still gets displayed because the parent view is not cutting off the content outside its bounds. One easy way to inspect the entire hierarchy is to call the hidden `recursiveDescription` method on a view while debugging as in `po [someParentView recursiveDescription]`. – Anurag Sep 13 '12 at 23:07
  • I think that is whats happening, but I don't understand why. Trying your suggestion, the size looks correct until I get up to UIWindow where it says 320x480. Everything below has 320x568. – David Sep 13 '12 at 23:58
  • Thank you so much Anurag, your comment led me to solving my similar issue. – lppier Dec 29 '12 at 08:55
  • check this link I solve my prob with this. :[button/tool Event overlap ][1] [1]: http://stackoverflow.com/questions/12501976/my-button-doesnt-detect-touch-events-on-iphone-retina-4-inch-simulator-but-w/16008891#16008891http://stackoverflow.com/questions/12501976/my-button-doesnt-detect-touch-events-on-iphone-retina-4-inch-simulator-but-w/16008891#16008891 – shreeji Apr 15 '13 at 07:21

5 Answers5

72

I had the same problem and noticed that my window.frame.size.height was still 480.0.

Solved this problem by enabling Full Screen at Launch for the MainWindow.xib file:

Steps:

  1. Open MainWindow.xib
  2. Select the Window element
  3. Open the Attributes Inspector
  4. Under Window section, enable Full Screen at Launch
Min Tsai
  • 2,139
  • 21
  • 17
4

There are two solution to this problem :

  1. If you are using MainWindow follow these steps :

    a. Select MainWindow.xib b. Select 'Full Screen at Launch' from Windows option available in Attributes Inspector.

  2. If your application doesn't contain MainWindow then just add 'Self.View.Frame = [UIScreen mainScreen].bounds' in ViewDidLoad.

Community
  • 1
  • 1
Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
1

I your project has MainWindow.xib then you must have to set all splash images in order to compatible you app for iPhone 5 display.

Yashesh
  • 1,799
  • 1
  • 11
  • 29
0

My Project wasn't using MainWindow.xib. I added the following to viewDidLoad in View Controllers of all the screens:

self.view.frame = [UIScreen mainScreen].bounds;
Sanjay Chaudhry
  • 3,181
  • 1
  • 22
  • 31
  • didn't work, figure out how to turn the flag on for your main window in IB.. solves the problem. – Gmu Sep 16 '13 at 19:07
0

add

self.window.frame = [UIScreen mainScreen].bounds;

in this method:

-(BOOL)application:(UIApplication *)application 
didFinishLaunchingWithOptions:(NSDictionary*)options 

in your %your app name%AppDelegate.m file

abbood
  • 23,101
  • 16
  • 132
  • 246