Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS,动画视图';s约束导致错误“;“无法同时满足约束”;_Ios_Objective C - Fatal编程技术网

iOS,动画视图';s约束导致错误“;“无法同时满足约束”;

iOS,动画视图';s约束导致错误“;“无法同时满足约束”;,ios,objective-c,Ios,Objective C,我正在尝试设置容器视图约束之一的动画。在IB中,视图约束良好,没有错误或警告。在viewDidLoad中调用这些方法时,要更改视图y坐标,请执行以下操作: self.queueContainerYConst.constant += 550; [self.view layoutIfNeeded]; 我收到“无法满足约束…”的消息。在运行应用程序时,我的动画和UI看起来很好,所有内容似乎都受到了适当的约束。这是我在控制台中得到的全部信息 2015-05-03 14:17:52.668 S

我正在尝试设置容器视图约束之一的动画。在IB中,视图约束良好,没有错误或警告。在viewDidLoad中调用这些方法时,要更改视图y坐标,请执行以下操作:

 self.queueContainerYConst.constant += 550;
    [self.view layoutIfNeeded];
我收到“无法满足约束…”的消息。在运行应用程序时,我的动画和UI看起来很好,所有内容似乎都受到了适当的约束。这是我在控制台中得到的全部信息

2015-05-03 14:17:52.668 Streamacy[15914:3333195] 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) 
(
    "<NSLayoutConstraint:0x155a95c0 V:|-(614)-[UIView:0x155a83a0]   (Names: '|':UIView:0x155a91b0 )>",
    "<NSLayoutConstraint:0x155a95f0 V:[UIView:0x155a83a0]-(0)-|   (Names: '|':UIView:0x155a91b0 )>",
    "<NSLayoutConstraint:0x155af080 'UIView-Encapsulated-Layout-Height' V:[UIView:0x155a91b0(568)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x155a95f0 V:[UIView:0x155a83a0]-(0)-|   (Names: '|':UIView:0x155a91b0 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-05-03 14:17:52.684 Streamacy[15914:3333195] 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) 
(
    "<NSLayoutConstraint:0x1566a2a0 UIView:0x156a1900.width == UIView:0x156a1900.height>",
    "<NSLayoutConstraint:0x156a9000 V:[UIView:0x156a1900]-(32)-[UIProgressView:0x15688f30]>",
    "<NSLayoutConstraint:0x156a0df0 V:[UIProgressView:0x15688f30]-(11)-[MarqueeLabel:0x156a7360'Awake']>",
    "<NSLayoutConstraint:0x156a0eb0 UIView:0x1569dd90.trailingMargin == UIView:0x156a1900.trailing + 99>",
    "<NSLayoutConstraint:0x156a0f10 UIView:0x156a1900.leading == UIView:0x1569dd90.leadingMargin + 99>",
    "<NSLayoutConstraint:0x156a0f40 UIView:0x156a1900.top == UIView:0x1569dd90.topMargin - 46>",
    "<NSLayoutConstraint:0x156a92f0 V:[UILabel:0x156a6ea0'Tycho']-(17)-[UITableView:0x1587a000]>",
    "<NSLayoutConstraint:0x156a93b0 V:[MarqueeLabel:0x156a7360'Awake']-(2)-[UILabel:0x156a6ea0'Tycho']>",
    "<NSLayoutConstraint:0x156a94d0 V:[UITableView:0x1587a000]-(0)-[_UILayoutGuide:0x156a8b20]>",
    "<_UILayoutSupportConstraint:0x156a4cf0 V:[_UILayoutGuide:0x156a8b20(0)]>",
    "<_UILayoutSupportConstraint:0x156a4810 _UILayoutGuide:0x156a8b20.bottom == UIView:0x1569dd90.bottom>",
    "<NSLayoutConstraint:0x156b6070 'UIView-Encapsulated-Layout-Width' H:[UIView:0x1569dd90(320)]>",
    "<NSLayoutConstraint:0x156b60a0 'UIView-Encapsulated-Layout-Height' V:[UIView:0x1569dd90(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x1566a2a0 UIView:0x156a1900.width == UIView:0x156a1900.height>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-05-03 14:17:52.688 Streamacy[15914:3333195] 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) 
(
    "<NSLayoutConstraint:0x156a9000 V:[UIView:0x156a1900]-(32)-[UIProgressView:0x15688f30]>",
    "<NSLayoutConstraint:0x156a0df0 V:[UIProgressView:0x15688f30]-(11)-[MarqueeLabel:0x156a7360'Awake']>",
    "<NSLayoutConstraint:0x156a0f40 UIView:0x156a1900.top == UIView:0x1569dd90.topMargin - 46>",
    "<NSLayoutConstraint:0x156a92f0 V:[UILabel:0x156a6ea0'Tycho']-(17)-[UITableView:0x1587a000]>",
    "<NSLayoutConstraint:0x156a93b0 V:[MarqueeLabel:0x156a7360'Awake']-(2)-[UILabel:0x156a6ea0'Tycho']>",
    "<NSLayoutConstraint:0x156a94d0 V:[UITableView:0x1587a000]-(0)-[_UILayoutGuide:0x156a8b20]>",
    "<_UILayoutSupportConstraint:0x156a4cf0 V:[_UILayoutGuide:0x156a8b20(0)]>",
    "<_UILayoutSupportConstraint:0x156a4810 _UILayoutGuide:0x156a8b20.bottom == UIView:0x1569dd90.bottom>",
    "<NSLayoutConstraint:0x156b60a0 'UIView-Encapsulated-Layout-Height' V:[UIView:0x1569dd90(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x156a9000 V:[UIView:0x156a1900]-(32)-[UIProgressView:0x15688f30]>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-05-03 14:17:52.668 Streamacy[15914:3333195]无法同时满足约束。
可能下面列表中至少有一个约束是您不想要的。试着这样做:(1)看看每个约束,试着找出你不期望的约束;(2) 找到添加了不需要的约束的代码,然后修复它。(注意:如果您看到不理解的NSAutoresizingMaskLayoutConstraints,请参阅UIView属性TranslatesAutoResizingMaskToConstraints的文档)
(
"",
"",
""
)
将尝试通过打破约束进行恢复
在UIViewAlertForUnsatifiableConstraints处创建一个符号断点,以便在调试器中捕获该断点。
中列出的UIView上UIConstraintBasedLayoutDebugging类别中的方法也可能会有所帮助。
2015-05-03 14:17:52.684 Streamacy[15914:3333195]无法同时满足约束。
可能下面列表中至少有一个约束是您不想要的。试着这样做:(1)看看每个约束,试着找出你不期望的约束;(2) 找到添加了不需要的约束的代码,然后修复它。(注意:如果您看到不理解的NSAutoresizingMaskLayoutConstraints,请参阅UIView属性TranslatesAutoResizingMaskToConstraints的文档)
(
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
)
将尝试通过打破约束进行恢复
在UIViewAlertForUnsatifiableConstraints处创建一个符号断点,以便在调试器中捕获该断点。
中列出的UIView上UIConstraintBasedLayoutDebugging类别中的方法也可能会有所帮助。
2015-05-03 14:17:52.688 Streamacy[15914:3333195]无法同时满足约束。
可能下面列表中至少有一个约束是您不想要的。试着这样做:(1)看看每个约束,试着找出你不期望的约束;(2) 找到添加了不需要的约束的代码,然后修复它。(注意:如果您看到不理解的NSAutoresizingMaskLayoutConstraints,请参阅UIView属性TranslatesAutoResizingMaskToConstraints的文档)
(
"",
"",
"",
"",
"",
"",
"",
"",
""
)
将尝试通过打破约束进行恢复
在UIViewAlertForUnsatifiableConstraints处创建一个符号断点,以便在调试器中捕获该断点。
中列出的UIView上UIConstraintBasedLayoutDebugging类别中的方法也可能会有所帮助。

看来容器视图中的所有内容都放错了位置,为什么?。我是否不正确地设置/更改视图的动画

您的视图被过度约束。您的superview顶部的约束为614,底部的约束为0,但该视图的高度为568,因此这些数字不相加。如果出于您的目的,最好只使用其中一个垂直约束和一个固定的视图高度(如果您调整它以适应不同的屏幕大小,“固定”高度可以相对于superview的高度)

是的,这是正确的,谢谢。如何使视图的高度相对于超级视图?我可以在IB中这样做吗?@Andy是的,你可以在IB中这样做。选择视图及其超视图,然后从pin菜单中选择“等高”。然后编辑该约束,将乘数值从1更改为所需的分数。