我正在使用640x1136圖像作爲我的應用程序的背景,但圖像顯示爲放大。與啓動畫面相同的圖像顯示正確。我跟着發現的方向here。 兩個圖片,Xcode:在應用程序中調整背景圖像
原始圖像:
屏幕捕捉,仿真iPhone 6.1,並且看起來是在我的iPhone 5
的代碼我一樣我正在使用的是以下內容:
CGRect screenSize = [[UIScreen mainScreen]bounds];
if (screenSize.size.height == 568.0f) {
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"[email protected]"]];
}else {
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"[email protected]"]];
}
@ user2339310:好的,我從圖像中剪下了49個像素,結果相同。 Nishant Tyagi:我在iPhone 5上運行應用程序,放大效果既在模擬器上,也在iPhone上。 – Luis