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
I am using the following trick as some stuff actually works:
1x
, 2x
on the base of 320x6404 2x
and 3x
on the base of 320x568 (iPhone 5)2x
image for iPhone 6 in full resolution (750x1334)Declare a constant
#define IS_IPHONE_6 [[UIScreen mainScreen]nativeBounds].size.width == 750.0 ? true : false
and use it like this:
UIImage *image = [UIImage imageNamed:@"Default_Image_Name"];
if(IS_IPHONE_^) {
image = [UIImage imageNamed:@"Iphone6_Image_Name"];
}
this might be not the most beautiful solution, but it works, at least as long as apple does not provide a better API for edge to edge bindings.