在视图中锁定纵向方向? IOS 7 [英] Locking Portrait Orientation in View? iOS 7

查看:141
本文介绍了在视图中锁定纵向方向? IOS 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我想将主页的方向锁定为纵向,仅限主页。

So, I want to lock the orientation of my home page to portrait, and the Home page ONLY.

我正在使用标签栏控制器,所以最初view是选项卡控制器,但首先出现的视图控制器是第一个选项卡,例如主页。

I am using a tab bar controller, so the initial view is the tab controller, but the view controller that appears first is the first tab, e.g. the Home page.

我想这样做,以便当用户转动设备时,它不会旋转到此页面上的横向。但是所有其他页面都可以旋转。

I would like to make it so that when the user goes to rotate the device, it WILL NOT rotate to landscape on this page. However all other pages can rotate.

我一直在搜索,似乎没有任何特定的iOS 7,并且特定于iOS 7的那个不起作用...

I have searched around, and nothing seems to be specific to iOS 7, and the one that is specific to iOS 7 doesn't work…

请帮忙,谢谢!

下图描述了我想要发生的事情,对于此页面。

The image below describes what I DON"T want to happen, for this page.

推荐答案

在实施中实施以下内容

- (NSUInteger) supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskPortrait;

}

这应该可以为您提供所需的结果!

This should give you the results you are looking for!

这篇关于在视图中锁定纵向方向? IOS 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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