iPad App只有肖像吗? [英] iPad App Portrait Only?

查看:63
本文介绍了iPad App只有肖像吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序完全是为IOS6设计的.我在iPhone上使用了xib,在iPad上使用了xib.尽管没有TabBarController本身的类,但我的AppDelegate设置了TabBarController. TabBarController有两个选项卡项目,一个是NavigationController,一个是View Controller,每个选项卡都有自己的类.我希望iPad能够以纵向模式,颠倒状态和正常状态运行.在Xcode中目标"的摘要选项卡上,我支持将界面方向设置为纵向"和纵向颠倒".

My app is entirely designed for IOS6. I use an xib for the iPhone and another one for the iPad. My AppDelegate sets up a TabBarController, though there is no class for the TabBarController itself. The TabBarController has two tab items, 1 a NavigationController, and 1 a View Controller, each of which has its own class. I would like the iPad to be able to run in just Portrait mode, upside down, and normal. On the summary tab of Target in Xcode, I have supported interface orientations set to Portrait and Portrait Upside Down.

我对iOS 6的理解是,您只需要放下

My understanding with iOS 6 is that you only need to put

- (NSUInteger)supportedInterfaceOrientations

在类的最高父控制器中

,并设置您希望使用哪个Masks以及要使用的所有子容器.因此,在导航控制器的根视图"控制器中,我输入:

in the highest parent controller of a class, and set which Masks you would like it and all the child containers to work with. So, in the Root View Controller of the Navigation Controller I put:

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown;
}

在每个子类中,我输入:

And in each of the child classes, I put:

- (BOOL)shouldAutorotate{

    if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad )
    {

        return YES;

    }
    else
    {
        return NO;
    }


}

然后我将相同的两个方法放在第二个选项卡中,这只是一个视图控制器类.

I then put the same two methods in the 2nd Tab which was just a View Controller Class.

我在iPad上安装了该应用程序,它在纵向模式下可以正常工作,但是当我将其倒置时却没有旋转.我退出了该应用程序,然后将iPad颠倒了,但是当我再次启动该应用程序时,它仍然停留在同一位置.因此,我彻底杀死了该应用程序,并从头到尾地将其启动.初始屏幕是上下颠倒的,但是当屏幕消失时,该应用仍仅以纵向模式显示,从而使显示上下颠倒.

I installed the app on my iPad, and it worked fine in portrait mode, but did not rotate when I turned it upside down. I exited the app and turned the iPad upside down, but when I started the app again, it still stayed in the same spot. So, I killed the app completely, and started it from the beginning upside down. The splash screen was upside down, but when the screen disappeared, the app was still only showing in portrait mode, making the display upside down.

我想念什么?

推荐答案

单击appName选择目标",然后选择要支持的方向.谢谢

click on appName select Target and just select the orientations which you want to support. thanks

这篇关于iPad App只有肖像吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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