Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode shows same height for 3.5 inch and 4 inch screen in ios

I test my app in 3.5 inch and 4 inch. While I NSLog(@"%@", self.view.frame.size.height); both 3.5 inch and 4 inch shows height 568. Now currently I m using xcode 5.. Any can please explain why this shows like that..

like image 898
Seeker Avatar asked Dec 02 '13 12:12

Seeker


2 Answers

I think you are using self.view.frame.size.height . In this condition app using your original view means your xib's height and may be your xib is 4 inch.

If you want to check UIDevice height than use this condition

if ([UIScreen mainScreen].bounds.size.height<568)
{
     NSLog(@"3.5 inch screen");
}
else
{
     NSLog(@"4.0 inch screen");
}
like image 158
Pradhyuman sinh Avatar answered Oct 16 '22 02:10

Pradhyuman sinh


You should have two launch images- one Default.png (for 3.5 inch) and another Default-568h.png (for 4 inch) in your app. Please check it.

like image 32
user2261451 Avatar answered Oct 16 '22 03:10

user2261451