Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For universal app with both portrait and landscape. not support perfect if use size #2

Closed
jerryzhoujw opened this issue Jun 17, 2015 · 4 comments
Assignees

Comments

@jerryzhoujw
Copy link

 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator: (id<UIViewControllerTransitionCoordinator>  __unused)coordinator {
     [self.backgroundImageView setImage:[UIImage assetLaunchImageWithSize:size  useSystemCache:YES]];
 }

the code above works perfect when I rotate the iPad, but for iPhone5s, when rotate to landscape, the background image still get from portrait image.

PS:
a.App support iOS8+
b.I use imageAsset launchImage to include bellow:
iOS8 and Later:iPhone Portrait
Landscape
iOS7 and Later:iPhone Portrait
iPad Portrait
Landscape

@TimurBK
Copy link
Owner

TimurBK commented Jun 17, 2015

@jerryzhoujw Thank you for your report, I'll look at this issue soon.

@jerryzhoujw
Copy link
Author

@TimurBK I think properly because LaunchImage is not supported for iPhone4/5/6(excepted 6plus) in landscape mode.
I use the temp solution bellow:

// iPhone6s {736, 414}
// iPhone6  {667, 375}
// iPhone5S {568, 320}
// iPhone5  {568, 320}
// iPhone4s {480, 320}
// NOTE: for iPhone4/4s/5/5s/6 LaunchImage don't include the Landscape mode.
if (size.width > size.height &&
    size.width <= 667) {
    [self.backgroundImageView setImage:[UIImage imageNamed:[NSString stringWithFormat:@"Default-Landscape-iPhone-%d",(int)size.width]]];
}else{
    [self.backgroundImageView setImage:[UIImage assetLaunchImageWithSize:size useSystemCache:YES]];
}

@TimurBK TimurBK self-assigned this Jun 17, 2015
@TimurBK
Copy link
Owner

TimurBK commented Jun 18, 2015

During creation of image name string I check that it's iPhone 6+ or iPad because there's no landscape launch images for smaller iPhones. Maybe there should be an option to disable this check so category will find this, but technically this is another image set.

@TimurBK
Copy link
Owner

TimurBK commented Jul 16, 2015

Will close this and open separate issue for enhancement.

@TimurBK TimurBK closed this as completed Jul 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants