【问题标题】:Autolayout adjusts perfect in iOS 7 but not in iOS 6自动布局在 iOS 7 中完美调整,但在 iOS 6 中没有
【发布时间】:2014-02-26 09:34:32
【问题描述】:

我的应用中有一个横向视图,并且我在情节提要中设置了 UI,因此它可以根据我想要的不同屏幕尺寸进行响应。现在这完全符合我在iOS 7 中的要求,但是当我在iOS 6 中运行应用程序时,它就像没有响应我的故事板设置:

我的应用主要是纵向的,所以应用中的这个视图通过子类化导航控制器设置为横向:

// CustomNavigationLandscapeViewController.m
- (BOOL)shouldAutorotate
{
    return NO;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

- (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

那么我做错了什么来获得这种行为吗?为什么它在iOS 7 中可以完美运行,而在iOS 6 中却不行?

【问题讨论】:

  • 自动布局从 iOS 6 到 iOS 7 确实发生了一些变化。iOS 6 是否也出现任何约束错误?
  • @footyapps27 没有约束错误或任何东西,但干净和重新启动似乎解决了我的问题。

标签: xcode ios6 ios7 uinavigationcontroller landscape-portrait


【解决方案1】:

重新启动 Xcode 并进行清理后,问题已解决。猜猜这只是 Xcode 中的一个小故障,在不恰当的时间出现。

【讨论】:

    猜你喜欢
    • 2013-10-10
    • 1970-01-01
    • 1970-01-01
    • 2012-11-18
    • 2017-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多