mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-01-11 22:40:19 +00:00
Update UI for iPads (ColourOptionsController.m)
Color Options was still locked in Portrait Mode which means the whole UI in Landscape on iPad Devices would look bad. So it’s been resolved.
This commit is contained in:
parent
168c82908d
commit
33fcaa7c2c
1 changed files with 12 additions and 8 deletions
|
|
@ -26,17 +26,21 @@
|
|||
self.selectedColor = color;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {
|
||||
CGRect screenRect = [[UIScreen mainScreen] bounds];
|
||||
CGFloat screenWidth = screenRect.size.width;
|
||||
if (screenWidth == 1024 || screenWidth == 1112) {
|
||||
self.view.transform = CGAffineTransformMakeScale(0.7, 0.7);
|
||||
}
|
||||
CGFloat scale = MIN(self.view.bounds.size.width / 1024, self.view.bounds.size.height / 768);
|
||||
self.view.transform = CGAffineTransformMakeScale(scale, scale);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
|
||||
[super traitCollectionDidChange:previousTraitCollection];
|
||||
[self loadView];
|
||||
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
|
||||
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
CGFloat scale = MIN(size.width / 1024, size.height / 768);
|
||||
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
|
||||
self.view.transform = CGAffineTransformMakeScale(scale, scale);
|
||||
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Loading…
Reference in a new issue