1

Possible Duplicate:
How to develop or migrate apps for iPhone 5 screen resolution?

Layout Issue

As I attached an Image, I've generated view in XIB for iPhone-5 screen size. When I'll run as iPhone-4s retina for iPhone5 screen, but It'll show like this in the simulator for the iPhone-4s screen.

I've done with all size settings auto with screen size attributes.

Actually Not getting to the status-bar issue. If the screen is not compatible with large screen, then also status-bar should be on top. But why is it so showing in the middle ?

Can anyone tell me the solution for this asap?

Thanks in advance.

Community
  • 1
  • 1
Manann Sseth
  • 2,745
  • 2
  • 30
  • 50

4 Answers4

2

You can add the splash Image to your project named Default-568h@2x.png

This will show your layout in full screen rather than displaying it in middle.

Akbari Dipali
  • 2,173
  • 1
  • 20
  • 26
0

Set this in App delegate class in Didfinishlaunching method:

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
Vishal
  • 8,246
  • 6
  • 37
  • 52
  • In whole Application, I'm getting the same issue. So this is not a feasible solution to hide the status - bar. I am not getting why the application is displayed in the middle. ? – Manann Sseth Dec 28 '12 at 06:50
  • I don't want to hide status-bar. So,I have created a Splash screeen for iPhone5 in resources/iphone (640x1136). Its name must be: Default-568h@2x.png Problem Solved. – Manann Sseth Dec 28 '12 at 07:24
  • 1
    Ya bro this is right solution... – Vishal Dec 28 '12 at 07:26
0

I have been successful in this earlier.

Write [[UIApplication sharedApplication] setStatusBarHidden:NO]; in AppDelegate and in .plist file set property Statusbar is initially hidden to YES.

Hope this will help you....:)

Krunal
  • 1,318
  • 1
  • 13
  • 31
  • In whole Application, I'm getting the same issue. So this is not a feasible solution to hide the status - bar. I am not getting why the application is displayed in the middle. ? – Manann Sseth Dec 28 '12 at 06:59
  • I don't want to hide status-bar. So,I have created a Splash screeen for iPhone5 in resources/iphone (640x1136). Its name must be: Default-568h@2x.png Problem Solved. – Manann Sseth Dec 28 '12 at 07:24
  • 1
    Yes..and the other way is you put Default images for iphone 4 and 5. Then, check programmatically whether current device is iphone 5 or 4. According to that, you can set image... – Krunal Dec 28 '12 at 07:31
-1

You can check device screen compatibility as below:

//Device Compatibility
#define g_IS_IPHONE             ( [[[UIDevice currentDevice] model] isEqualToString:@"iPhone"] )
#define g_IS_IPOD               ( [[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"] )
#define g_IS_IPAD               ( [[[UIDevice currentDevice] model] isEqualToString:@"iPad"] )
#define g_IS_IPHONE_5_SCREEN    [[UIScreen mainScreen] bounds].size.height >= 568.0f && [[UIScreen mainScreen] bounds].size.height < 1024.0f
#define g_IS_IPHONE_4_SCREEN    [[UIScreen mainScreen] bounds].size.height >= 480.0f && [[UIScreen mainScreen] bounds].size.height < 568.0f


if(g_IS_IPHONE_5_SCREEN)
{
    if(g_IS_IPHONE)
        NSLog(@"Hey, this is an iPhone 5 screen!");
    else if(g_IS_IPOD)
        NSLog(@"Hey, this is an iPod 5 screen!");
    else
        NSLog(@"Hey, this is a simulator screen with iPhone 5 screen height!");
}
else if(g_IS_IPHONE_4_SCREEN)
{
    if(g_IS_IPHONE)
        NSLog(@"Hey, this is a lower iPhone screen than 5!");
    else if(g_IS_IPOD)
        NSLog(@"Hey, this is a lower iPod screen than 5!");
    else
        NSLog(@"Hey, this is a lower simulator screen than 5!");
}
else if(g_IS_IPAD){
    NSLog(@"Hey, this is an iPad screen!");
}
else{
    NSLog(@"Hey, this is an ipad simulator screen!");
}

Cheers!

Nishant B
  • 2,897
  • 1
  • 18
  • 25