仅限人像模式 - iOS [英] Portrait mode only-iOS

查看:96
本文介绍了仅限人像模式 - iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,仅用于纵向方向。但是我不知道如何限制只使用纵向模式,一旦用户颠倒或使用LANDpace模式,我不希望我的屏幕orinetation相应地改变。

I have an application and designed for only for portrait orientation. However I dont know how to restrict to use only portrait mode, once user upside down or landspace mode, I dont want my screen orinetation changes accordingly.

任何想法怎么做它?

推荐答案

可以在App Summary中指定(也可以在rootviewcontroller中指定(无论是导航控制器,TabBar)控制器等)通过覆盖此方法:

That can be specified in the App Summary (and also in the rootviewcontroller (whether that be a Nav Controller, TabBar Controller, etc) by overriding this method:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

这篇关于仅限人像模式 - iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆