Reputation: 152
I see some people asking how to get their 3.5-inch apps to support a 4-inch display. I'm asking the opposite. I originally built this app to work on the iPhone (4-inch) and iPad, but I also want it to work on the iPhones with 3.5 inch screens. (I want to scale it down without warping the image).
Any tips?
Thanks!
Upvotes: 1
Views: 1205
Reputation: 152
Thanks for all you help guys! I fixed it by making two separate storyboards for each size and used this code in my .m file:
-(void) checkScreen {
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
UIStoryboard *iPhone5Storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
}
if(result.height == 568)
{
UIStoryboard *iPhone4Storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone copy" bundle:nil];
}
}
}
Upvotes: 1
Reputation: 5824
To expand a bit on Aaron Golden's comment (e.g., the need to have separate launch images), you will also need to come up with a scheme to maximize the reuse of your images across devices. This is due to the different aspect ratios of each of the devices.
One approach to consider is to create a background pattern that you want for your background (apply to your views by setting the background color, with the color created from the UIColor
colorWithPattern
method). You may be able to use the same background pattern across all the devices. Then use a "foreground" image on top of the background. That way you may be able to use, for example, your swirl image on both the 3.5" and 4" iPhones.
Upvotes: 0