#pragma mark - 重写屏幕方向发生改变触发的方法
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
// 判断为横屏或者竖屏
if (!UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
// 调用调整位置的方法
[self _initAllItemsWithHorizontal];
} else {
[self _initAllItemsWithVertical];
}
}
if (self.interfaceOrientation == 1) { // 屏幕竖直
[self _moveUpVertical:-30];
} else if (self.interfaceOrientation == 2) { // 屏幕垂直翻转
[self _moveUpVertical:30];
} else if (self.interfaceOrientation == 3) { // 屏幕倒向右侧
[self _moveUpHorizontal:110];
} else if (self.interfaceOrientation == 4) { // 屏幕倒向左侧
[self _moveUpHorizontal:-110];
}
// 关于屏幕的方向
// typedef NS_ENUM(NSInteger, UIInterfaceOrientation) {
// UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait,
// UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
// UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight,
// UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft
// };