ios - 禁用当前屏幕的旋转?

标签 ios interface-orientation

是否可以为当前屏幕启用/禁用旋转参数,或者此属性适用于所有应用程序?

最佳答案

当然:

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    //Choose your available orientation, you can also support more tipe using the symbol |
    //e.g. return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight)
    return (UIInterfaceOrientationMaskPortrait);
}

关于ios - 禁用当前屏幕的旋转?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23468758/

相关文章:

android - 在 cordova 内打开适用于 ios、android 和 windows 的外部应用程序

iphone - 未检测到 iPad 启动方向

cocoa-touch - 在 iPad 上处理多个窗口的方向

ios - iPad 模态视图 Controller 在关闭时旋转界面

ios - NSDictionary 变成 NSCFString

ios - 将数据发布到服务器以获得响应

ios - 运行 iOS 模拟器时出现伪终端设置错误

ios - X秒后关闭模态ViewController

ios - 使用 OpenGL 自定义 iOS 界面方向更改动画