2014-11-21 82 views
0

我有一款遊戲適用於iPhone 4 & iPhone 5屏幕。一切運行良好的iOS 7上,但在iOS8上的 當我構建與iOS 8的iPhone 5的項目顯示帶有黑色條紋的iPhone4.xib,這意味着它不檢測iPhone 5屏幕。如何解決這個問題?如何檢測iOS 5中的iPhone 5屏幕8

回答

0

我解決了這個問題。

在此之前,我通過[VSUtils isIPhone5Screen]檢查了應用程序運行在哪個設備上。 在iOS8上不起作用。

我已經這樣做了:

#define SYSTEM_VERSION_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) 
#define SYSTEM_VERSION_GREATER_THAN(v)    ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) 
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) 
#define SYSTEM_VERSION_LESS_THAN(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) 
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) 

if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")){ 
    ... 
} 
+0

你應該編輯你的問題。你的問題不清楚。另外,請提供'[VSUtils isIPhone5Stsreensch]'的代碼' 現在很好用 – 2014-11-24 20:19:30

0

我的理解是,這是你想要做什麼

你需要做的添加LaunchScreen.xib你的應用程序是兼容iOS上8 如果要支持的iOS < 8,你必須添加一個iPhone 5分辨率(640x1136)大小的名爲[email protected]

黑PNG文件這是蘋果如何建議添加LaunchScreen.xib https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html#//apple_ref/doc/uid/TP40012582-CH28-SW4

+0

不,你沒有正確的理解。我有iphone 4和iphone 5屏幕的xibs。我檢查一下正在運行的[VSUtils isIPhone5Stsreensch]並啓動相應的xib。在iOS 7上一切運行良好,但在iOS8上構建iPhone 5的項目時,在iOS8上顯示帶有黑色條紋的iphone4.xib。 – Ptah 2014-11-21 10:30:55

+0

如何檢查應用程序在哪個設備/模擬器上運行? – 2014-11-24 05:28:58