willrotatetointerfaceorientation
#import
Willrotatetointerfaceorientation
@interface SPWKBaseCollectionViewController : UICollectionViewController
@end
#import “SPWKBaseCollectionViewController.h”
@implementation SPWKBaseCollectionViewController
willrotatetointerfaceorientation get more info willrotatetointerfaceorientation
– (void)viewDidLoad
{
[super viewDidLoad];
[self updateContentInsetsForInterfaceOrientation:self.interfaceOrientation];
}
– (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[self updateContentInsetsForInterfaceOrientation:toInterfaceOrientation];
willrotatetointerfaceorientation here willrotatetointerfaceorientation
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
}
– (void)updateContentInsetsForInterfaceOrientation:(UIInterfaceOrientation)orientation
{
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
UIEdgeInsets insets;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
willrotatetointerfaceorientation check here willrotatetointerfaceorientation
insets = UIEdgeInsetsMake(64, 0, 56, 0);
} else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
if (UIInterfaceOrientationIsPortrait(orientation)) {
insets = UIEdgeInsetsMake(64, 0, 49, 0);
} else {
insets = UIEdgeInsetsMake(52, 0, 49, 0);
}
}
self.collectionView.contentInset = insets;
willrotatetointerfaceorientation check here willrotatetointerfaceorientation
self.collectionView.scrollIndicatorInsets = insets;
}
}
@end
self.webView.scrollView.contentInset = insets;
self.webView.scrollView.scrollIndicatorInsets = insets;
willrotatetointerfaceorientation