1

我有一个用于横向模式的独特 viewController,问题是当我转到横向视图控制器(模态 segue)时,iAD 消失了,而且它似乎也停止接收委托方法。只有当我点击标签栏以转到另一个视图然后再次返回时,它才会再次显示

- (void)orientationChanged:(NSNotification *)notification

{
    NSLog(@"orientation changed");
    UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;

    if (UIDeviceOrientationIsLandscape(deviceOrientation) && !isShowingLandscapeView && isThisView)
    {
        //[self.view bringSubviewToFront:self.backgroundImageView];
        [self performSegueWithIdentifier:@"DisplayLandscapeView" sender:self];
        isShowingLandscapeView = YES;
    }

    else if (deviceOrientation ==  UIDeviceOrientationPortrait && isShowingLandscapeView)
    {
        [self dismissViewControllerAnimated:YES completion:nil];
        isShowingLandscapeView = NO;
        self.bannerView.hidden = NO;
        //[self.view sendSubviewToBack:self.backgroundImageView];
    }
}
4

0 回答 0