3

I'm developing a game in Swift (but not sprite kit), and i'm having a lot of trouble to make a background image that look great in every device. I recently understand the concept of the @1x, @2x and @3x images and it's pixels, but i can't find any place that say what size (width and height) an background image must have to look good both in canvas mode, preview mode and in action.

Anyone can help me?

For help, i'm attaching two print screens of a test that i made.

Thanks for the help :)

Image on Xcode 7 canvas

image in preview mode. Notice how he cut the edges

Rashwan L
  • 38,237
  • 7
  • 103
  • 107
Zé Moreira
  • 125
  • 1
  • 2
  • 9

1 Answers1

1

Size Icon For Devices:
Size Image Device Iphone

UIImageView *imageView = [UIImageView alloc]init]; 
imageView.frame = CGRectMake(0,0,widthInt,heightInt);
imageView.image = [UIImage ImageWithName:@"nameImage.png"];
Moosa
  • 89
  • 1
  • 8
  • i want the app to be for all devices (iphone and ipad), i know about auto layout, stack views and etc...my doubt is about the background image. I have to design in all this resolutions? And how i implement them in the canvas of xcode and in the app? I also didn't understand what the code that you pasted above do =/ – Zé Moreira Dec 25 '15 at 17:18
  • This is the same thing that bothers me. Everyone appears to mix these up. These are resolutions, but the assets are supposed to be given only in three sizes (x1, x2, x3). What would be useful is knowing what sizes those are. – André Fratelli Nov 18 '16 at 09:34
  • @AndréFratelli, I also have a problem http://stackoverflow.com/questions/43995059/how-to-add-images-for-different-screen-size-from-assets-xcassets-in-xcode-8 :( – May Phyu May 16 '17 at 07:46