Im在這一段時間裏掙扎着,我無法找到任何有相關問題的人。 我的問題是,在iPad上爲橫向模式加載的背景圖像不是正確的(它削弱了圖像的肖像版本)。 在iPhone或iPod上,它的工作方式與其應有的相同。navigationBar背景圖像在橫向模式下的iOS 5上的圖像
使用我的AppDelegate文件中的代碼IM如下:
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0) {
// Create resizable images
UIImage *gradientImageP = [[UIImage imageNamed:@"header"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
UIImage *gradientImageL = [[UIImage imageNamed:@"header-Landscape"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UINavigationBar appearance] setBackgroundImage:gradientImageP
forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:gradientImageL
forBarMetrics:UIBarMetricsLandscapePhone];
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent];
[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:0 green: 0 blue:0 alpha:1]];
}
的問題是在這條線?
[[UINavigationBar appearance] setBackgroundImage:gradientImageL
forBarMetrics:UIBarMetricsLandscapePhone];
我的圖片名稱如下:
- 頭 - 風景〜iphone.png
- [email protected]~iphone.png
- 頭 - 風景〜ipad.png
- header〜iphone.png
- [email protected]~iphone.png
- header〜ipad
編輯:導航欄上的問題的截圖:
- iPhone畫像: http://imageshack.us/photo/my-images/200/iphoneportrait.png/
- iPhone景觀: http://imageshack.us/photo/my-images/193/iphonelandscape.png/
- iPad的肖像: http://imageshack.us/photo/my-images/62/ipadportrait.png/
- iPad的景觀: http://imageshack.us/photo/my-images/200/ipadlandscape.png/
任何人有這個問題嗎? 即時通信開放就如何解決這個想法,TKZ
你期待的ipad〜在iPad上,而不是被加載?我以前沒有見過這個約定。你有一些自動爲你做的代碼嗎? – Travis
是的,我希望在該設備上加載〜ipad的文件名。我在應用程序的其他圖像上使用這種名稱,並正確加載。無論如何,我嘗試了所有文件的各種類型的文件名,但對於navBar,這個問題仍然存在:\ – iruleonu