iOS: Preparing background images for applications

前端 未结 7 969
执笔经年
执笔经年 2020-12-23 14:51

Mostly every iOS application has a view with an image as background. Is there any image sizing guide out there? For example here is an iOS screen designed in Sketch:

7条回答
  •  既然无缘
    2020-12-23 15:11

    Take a look at the page on documentation, there is Static Launch Screen Images, and you can catch sizes from there.

    You can get a device screen size, using

    CGSize screenSize = [UIScreen mainScreen].bounds.size // (Objective-C)
    
    
    let screenSize: CGSize = UIScreen.mainScreen().bounds.size // (Swift)
    

    And after you can programmatically select an image you want, from set of an images from the bundle. Or to make a big one image for resizing, using knowledges from documentation, and to resize an image accordingly. Or...your choice.

    Different "sizes" @2x, @3x is scale. And here is the nice explanation.

提交回复
热议问题