How to specify size for iPhone 6/7 customised edge-to-edge image?

后端 未结 12 1005
死守一世寂寞
死守一世寂寞 2020-11-28 01:59

Say I want a bundled image to take up all available screen width in an iPhone app - for example a banner. I\'d create my_banner.png with width 320px

12条回答
  •  佛祖请我去吃肉
    2020-11-28 02:09

    FIRST of all, you need to configure your imageView to cover all the screen, Autolayout will help a lot for this job, take a look on the link below and find how to Pin the constraints (Leading Space, Trailing Space, Top Space and Bottom Space) using Storyboards:

    http://www.thinkandbuild.it/learn-to-love-auto-layout/

    enter image description here

    SECOND step is create device specific image sets on your image assets (image below), to display different images according to device.

    enter image description here

    Check out this infographic: http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions

    It explains the differences between old iPhones, iPhone 6 and iPhone 6 Plus. You can see comparison of screen sizes in points, rendered pixels and physical pixels

    That's all

    enter image description here

    enter image description here

    Please, give a feedback if you have any trouble.

提交回复
热议问题