2

In my iphone application I am using a background image bg.png (for retina size bg@2x.png). I updated xcode to 4.5. Now I need to arrange the UI for fit into iPhone 5 - 4 inch display. Since the frame height will become 568, I need to fix my background also having a height 568. I added a image named bg-568h@2x.png in my app. But Iam not getting this image for iPhone 6 simulator in xcode. Is there any way to get this image? or how can I achieve this?

Dev
  • 3,885
  • 10
  • 39
  • 65
  • 1
    I think, this can be helpful for you: http://stackoverflow.com/questions/12532405/images-for-iphone-5-retina-display – Andrey Oct 08 '12 at 10:01

2 Answers2

1

Try this dynamic code....

self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bg.png"]];

or

This creates a memory leak. Either change initWithPatternImage to colorWithPatternImage, or assign your UIColor object to a variable and properly release it:

UIColor *color = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bg.png"]];
self.view.backgroundColor = color;
[color release];
Vikas S Singh
  • 1,748
  • 1
  • 14
  • 29
0

How about setting bg-568h@2x.png to be the background image, and set the ImageView scaling to Aspect Fill?

Freney
  • 1,174
  • 1
  • 11
  • 26