简体   繁体   English

iOS,全屏图片不足4

[英]iOS, full screen image falls short on 4

I am using an image as the full view background image. 我正在使用图像作为全视图背景图像。 The image is provided in @2x (750 X 1334) & @3x (1242 X 2208). 以@ 2x(750 X 1334)和@ 3x(1242 X 2208)提供图像。 When i simulate on 5 & 4S it all appears fine, however i have executed the app on a real device, iPhone 4. It appears as if the image falls short of the top. 当我在5和4S上进行模拟时,一切似乎都很好,但是我已在真实设备iPhone 4上执行了该应用程序。它看起来好像图像没有达到顶部。 I am using Scale to fit mode on the view which according to apple, should rescale the image to the window frame of the device. 我在根据苹果的视图上使用“缩放以适应模式”,应将图像重新缩放到设备的窗口框架。

iPhone 4

iphone 5

iPhone 4s

Is this a image resolution issue, or is there additional work to support the iPhone 4? 这是图像分辨率问题,还是需要其他工作来支持iPhone 4?

self.view.layer.contents = (id) [UIImage imageNamed:@"Launch Image.png"].CGImage;

Im not sure why setting the image using Storyboard caused the offset for the iPhone 4 but i was able to resolve the issue using the line of code above. 我不确定为什么使用Storyboard设置图像会导致iPhone 4偏移,但是我能够使用上面的代码行解决问题。

I have to admit, CALayers are going to come in handy 我必须承认,CALayers将派上用场

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM