2
votes

In my iphone application I am using a background image bg.png (for retina size [email protected]). 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 [email protected] 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?

2
I think, this can be helpful for you: stackoverflow.com/questions/12532405/…Andrey

2 Answers

1
votes

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];
0
votes

How about setting [email protected] to be the background image, and set the ImageView scaling to Aspect Fill?