iPad UIInterfaceOrientation发布后图像

iPad UIInterfaceOrientation发布后图像,ipad,rotation,launch,uiinterfaceorientation,launching-application,Ipad,Rotation,Launch,Uiinterfaceorientation,Launching Application,我的应用程序应该只支持landescape模式,因此我配置info.plist键以正确的方式获取它。 我的根viewcontroller是我添加到主窗口的自定义UINavigationController,它实现 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations

我的应用程序应该只支持landescape模式,因此我配置info.plist键以正确的方式获取它。
我的根viewcontroller是我添加到主窗口的自定义UINavigationController,它实现

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
问题是,在ApplicationIDFinishLaunching之后,
interfaceOrientation
始终是UIInterfaceOrientation和SCAPERight,即使应用程序是以UIInterfaceOrientation和SCAPELeft方向启动的。
结果是,飞溅图像方向正确,而应用程序则朝上向下。
晃动设备一段时间,使控制器再次朝正确方向旋转


是虫子吗?我该如何解决这个问题?

这对我来说非常有用

  • (布尔)应自动旋转指针面定向(UIInterfaceOrientation)面定向 {

    if(UIInterfaceOrientationIsLandscape(interfaceOrientation)){

    返回YES

    }否则{

    返回否

    }

    }


祝你好运

这和我的代码是一样的。问题不在于if statement,而是应该是interface-orientation和scapeleft而不是interface-orientation和scaperight的interface-orientation。