0

what size of bg images should i use for iphone 6 and iphone 6+ apps.And what should be the extension for the same. As I read some thread, i come to know we should use @2x images for iphone 6. But @2x images also used by 4s devices; then how would you differentiate between the images used by 4s devices and iphone 6.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Saggy
  • 465
  • 5
  • 18

2 Answers2

0

Yes.It uses same imageName@2x.png from iPhone4s to iphone 6. but you can get the nativeBounds and nativeScale from screenbounds

Also, you can use this :

For example:

For example: enter image description here

If you're displaying an photo in a UIImageView though, you can just create the largest size and let it either scale down to the iPhone 4s (using UIViewContentModeScaleAspectFill) or leave it as-is (using UIViewContentModeCenter).

For your Bg concern : you can use autolayout constraints with the ImageView. Also, you can Usethis

itechnician
  • 1,645
  • 1
  • 14
  • 24
  • thanks for reply, but my concern is about the background image, which will occupy whole device screen. how would you differentiate between them for 4s and iphone 6, since both have @2x extension? – Saggy Oct 16 '14 at 09:32
0

I use the following code to determine what device is running (it's a little bit quick and dirty but it does the trick)

if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ){

    CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
    CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
    if( screenHeight < screenWidth ){
        screenHeight = screenWidth;
    }

    if( screenHeight > 480 && screenHeight < 667 ){
        DLog(@"iPhone 5/5s");
    } else if ( screenHeight > 480 && screenHeight < 736 ){
        DLog(@"iPhone 6");
    } else if ( screenHeight > 480 ){
        DLog(@"iPhone 6 Plus");
    } else {
        DLog(@"iPhone 4/4s");
    }
}

And the sizes are: enter image description here

Roland Keesom
  • 8,180
  • 5
  • 45
  • 52