gpt4 book ai didi

iphone - iOS 应用程序无法在 iOS 6 或更低版本上运行

转载 作者:行者123 更新时间:2023-11-28 22:27:15 25 4
gpt4 key购买 nike

我正在我的手机上使用 Xcode 5 和 iOS 7 制作一个 iPhone 应用程序;该应用程序适用于 iOS 7。但是,当我在 iPhone 6.1 模拟器上运行该应用程序时,我收到以下消息:

2013-09-01 10:46:30.075 Bars[30745:c07] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't
want. Try this: (1) look at each constraint and try to figure out which you don't
expect; (2) find the code that added the unwanted constraint or constraints and
fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you
don't understand, refer to the documentation for the UIView
property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x81b80a0 h=--- v=--- V:[UIWindow:0x8196f60(480)]>",
"<NSAutoresizingMaskLayoutConstraint:0x81b6910 h=-&- v=-&- UILayoutContainerView:0x8197530.height == UIWindow:0x8196f60.height>",
"<NSAutoresizingMaskLayoutConstraint:0x81b53b0 h=-&- v=-&- UITransitionView:0x75c0830.height == UILayoutContainerView:0x8197530.height - 49>",
"<NSAutoresizingMaskLayoutConstraint:0x81b40f0 h=-&- v=-&- UIViewControllerWrapperView:0x75f38e0.height == UITransitionView:0x75c0830.height>",
"<NSLayoutConstraint:0x75f5d10 V:[UILabel:0x75f6ee0(24)]>",
"<NSAutoresizingMaskLayoutConstraint:0x81b29b0 h=-&- v=-&- UIView:0x75f7500.height == UIViewControllerWrapperView:0x75f38e0.height>",
"<NSLayoutConstraint:0x7578850 V:[UILabel:0x75f7220]-(124)-| (Names: '|':UIView:0x75f7500 )>",
"<NSLayoutConstraint:0x75fbfc0 UILabel:0x75f7220.baseline == UILabel:0x75f6ee0.baseline>",
"<NSLayoutConstraint:0x75fbcc0 V:[UIView:0x75f3ab0]-(11)-[UILabel:0x75f6ee0]>",
"<NSLayoutConstraint:0x75fbe40 V:|-(321)-[UIView:0x75f7160] (Names: '|':UIView:0x75f7500 )>",
"<NSLayoutConstraint:0x75fbe80 UIView:0x75f7160.top == UIView:0x75f3ab0.top>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x75f5d10 V:[UILabel:0x75f6ee0(24)]>

Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

我尝试删除所有约束,但出现错误提示我需要约束。我是 Objective-C 的新手,所以我真的不知道如何阅读这些内容。如果您能使您的答案非常简单,那将非常有帮助!

最佳答案

请记住,iOS 7 仍处于保密协议(protocol)中。

此日志的意思是,您正在使用自动布局并且您有两个相互矛盾的约束。

例如:你的观点有限制:

  • 10px top to superview
  • 60px 底部到 super View
  • 498px 高度

这适用于任何 super View ,即 568pt 高度。因此,例如在 iPhone 5 上的全屏应用程序上。一旦 super View 的大小发生变化(例如,当您的设备大小不同时),您将收到错误消息。

尝试两件事:

  1. 永远不要对一个对象施加所有约束。要么:

    • 顶部和底部间距(当尺寸改变时,这会改变高度)
    • 顶部间距和高度(如果尺寸改变,这将改变底部的空间)
    • 底部间距和高度(将改变顶部的空间)
    • 同样适用于左、右和宽度
  2. 尝试在您的 View Controller 上设置使用全屏。由于 NDA,我目前无法解释 iOS 7 和 iOS 6 在这方面的区别,但我认为这可能会有所帮助。

关于iphone - iOS 应用程序无法在 iOS 6 或更低版本上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18557264/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com