2

Some of my users seem to consistently see a clipped screen when running my app on their 4-inch devices. It may be limited to iPod Touch 5g users, and seems to occur on iOS6 and iOS7 (I am still investigating). I have what I think is a simple and correct UILaunchImageFile configuration, and it works fine on my iPhone 5 and in all the simulators. Any ideas?

Info.plist:

...
<key>UILaunchImageFile~ipad</key>
<string>UILaunchImage-iPad</string>
<key>UILaunchImageFile~iphone</key>
<string>UILaunchImage</string>
...

App product filesystem:

MyApp.app/
     ...
     Info.plist
     UILaunchImage-568h@2x.png    (640x1136)
     UILaunchImage-iPad.png       (768x1024)
     UILaunchImage-iPad@2x.png    (1536x2048)
     UILaunchImage.png            (320x480)
     UILaunchImage@2x.png         (640x960)
     ...

[EDIT: my startup code, in MyAppDelegate]

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    ...

    // screen.bounds is the whole display size;
    // screen.applicationFrame is smaller when you show the status bar
    UIScreen * screen = [UIScreen mainScreen];
    CGRect screenBounds = screen.bounds;
    CGRect applicationFrame = screen.applicationFrame;
    self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease];

    // load main ui
    MyUIViewController * main = [[[MyUIViewController alloc] initWithNibName:@"MyUIViewController" bundle:nil] autorelease];
    UIView * rootView = [[[UIView alloc] initWithFrame:screenBounds] autorelease];
    main.view = rootView;
    [main loadIfNeeded];

    self.viewController = main;
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];

    ...
}
jd.
  • 1,142
  • 8
  • 14
  • make all your viewcontrollers Simulator metrics to 4 inch screen, i hope this will works.... – Bhrigesh Oct 04 '13 at 06:52
  • i think you have to resize your window ... you can follow the link to resize window :- http://stackoverflow.com/questions/8156799/how-to-make-a-custom-view-resize-with-the-window-with-cocoa-auto-layout – Bhrigesh Oct 04 '13 at 07:22
  • @Bhrigesh, that link is for programming MacOS X, not iOS. – jd. Oct 05 '13 at 06:21
  • @Bhrigesh, I do not use Simulated Metrics, but set the frames of the view myself. I create my own window in code by passing in [[UIScreen mainScreen] bounds] -- code now included. – jd. Oct 05 '13 at 06:34

0 Answers0