关于旋转的一些设置

在现在做的iPad项目中,我们采用的是一个controller对应2个view。



一个view是默认的。

一个view是自己创建的,用于旋转屏幕后显示。

对应的代码为:

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    if (toInterfaceOrientation == UIInterfaceOrientationPortrait ||
        toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
        [viewLandscape_ removeFromSuperview];
    }
    else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
             toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
        [self.view addSubview:viewLandscape_];
    }
}

用上面这个方法主要是在旋转过程中执行,画面更加流畅。

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...