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

后端 未结 12 996
死守一世寂寞
死守一世寂寞 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:18

    Just measure the device dimensions and call the image that you want. ie Do it programatically

    So in your appdelegate have globals

    deviceHeight = self.window.frame.size.height;
    deviceWidth = self.window.frame.size.width;
    

    that you can call repeatedly. Then check them and call the appropriate image

    if (deviceWidth == 640){
    image = IPHONE4IMAGE;
    deviceString = @"iPhone4";
    }
    else...
    

提交回复
热议问题