0

我的应用程序应该只支持landescape模式,所以我配置的Info.plist键得到它以正确的方式。
我的根视图控制器是一个自定义的UINavigationController,我添加到主窗口和实施iPad的UIInterfaceOrientation后启动图像

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)); 
} 

的问题是,在applicationDidFinishLaunching后,interfaceOrientation总是UIInterfaceOrientationLandscapeRight即使应用UIInterfaceOrientationLandscapeLeft方向推出。
结果是防溅图像被适当地定向,而应用程序是倒置。
摇晃了一阵装置,使控制器在正确的方向再次旋转。

它是一个错误吗?我该如何解决这个问题?

回答

0

这个伟大的工程,我

  • (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation {

    如果(UIInterfaceOrientationIsLandscape(interfaceOrientation)){

    返回YES;

    } else {

    return NO;

    }

    }

好运

+0

这是相同的有我的代码。问题不在于if state,而是interfaceOrientation应该是interfaceOrientationLandscapeLeft,而不是interfaceOrientationLandscapeRight。 – pasine