1

In the home screen of my app I have to get the background image to stretch the length of the screen. But I have a translucent toolbar that the background image will not go under. I have tree buttons on the screen but the image just goes over the buttons and i cannot bring set the buttons to bring to front because the control for doing so is disabled. Any ideas of how to make it stretch the full length of the screen?

4

1 回答 1

0

理想情况下,您应该提供一组正确尺寸和纵横比的图像,如下所示:

iPad

  • 标准:1024x768 = myAsset.png
  • 视网膜:2048x1536 = myAsset@2x.png

苹果手机

  • 标准:320x480 = myAsset.png
  • 视网膜:640x960 = myAsset@2x.png
  • 4 英寸:640x1136 = myAsset-568h@2x.png

. . . 如上所示,文件名用于指示 UIKit 为给定设备使用哪个版本。

选择

如果您无法提供正确尺寸的图像,您可以创建自定义 UIImageView 背景视图,并将此视图的contentMode属性设置为 UIViewContentModeAspectFit 或 UIViewContentModeAspectFill。

使用矢量图形?

第三个(尚未广泛使用)选项可能是使用矢量图形。通过读取由 Illustrator 等以设计人员为中心的工具生成的资产,或通过使用像PaintCode这样的以开发人员为中心的工具生成的资产。

于 2013-10-13T22:50:07.073 回答