Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

ios - xcode when i run program on iphone 5 screen looks iphone 4

I'm using Xcode 6 and use objective-c when i test program on iOS 8 (iPhone 5) program run without error but when i try to test program on iOS 7 (iPhone 5) screen look like iPhone 4 screen. I can detect phone like this;

#define iPhone6Plus ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 736)
#define iPhone6 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 667)
#define IS_IPHONE_5 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)
#define IS_IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad

and also i can detect operating system like this;

if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_0)
{
    #define IS_IPHONE_5 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)
}

When i do this screen not scale on phone because when i run on iOS 7 phone screen run like iPhone 4 check image for more description. enter image description here

As you can see top and bottom black.How can i fix this problem

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

enter image description here

Set an iPhone 5 launch screen. It will be fixed.

iPhone 5 launch screen spec: 640x1136

For the time being create a blank screen on photoshop or preview. You can replace it later.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...