如何让应用保持纵向模式 [英] How to keep app in portrait mode

查看:26
本文介绍了如何让应用保持纵向模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用在运行时似乎无法保持纵向模式,我将支持的设备方向设置为仅纵向并且它仍然旋转,感谢所有帮助,谢谢!

I can't seem to keep my app in portrait mode when I run it, I set supported device orientations to only portrait and it still rotates, all help will be appreciated, thanks!

推荐答案

把这个写给你所有的视图控制器:

Write this to all your viewcontrollers:

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

这篇关于如何让应用保持纵向模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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