用作分隔符的UIView搞砸了我的约束

时间:2017-10-11 08:24:42

标签: ios iphone swift

我使用UIView作为我的UITableViewCells的分隔符但是在删除单元格时我没有使用任何方法来删除UIView。我不知道当我移除单元格时是否删除了UIView,但是其他UIViewControllers上的一些按钮约束搞砸了。

对于那些按钮,我使用了一种方法将它们绑定到键盘(当键盘处于非活动状态时坚持到底部,当键盘处于活动状态时坚持键盘),这种方法完美无缺(测试了一周)直到我将此uiview添加为分离器方法。尽管删除了这个方法,我的约束仍然是f * kd,我在调试器中得到了这个

"<NSAutoresizingMaskLayoutConstraint:0x60000029d6a0 h=--& v=--& UIButton:0x7f9a07538760'ADAUGA'.width == 320   (active)>",
    "<NSLayoutConstraint:0x604000296e40 UIButton:0x7f9a07538760'ADAUGA'.leading == UILayoutGuide:0x6040007a0540'UIViewSafeAreaLayoutGuide'.leading   (active)>",
    "<NSLayoutConstraint:0x604000296df0 UIButton:0x7f9a07538760'ADAUGA'.trailing == UILayoutGuide:0x6040007a0540'UIViewSafeAreaLayoutGuide'.trailing   (active)>",
    "<NSLayoutConstraint:0x60000029bcb0 'UIView-Encapsulated-Layout-Width' UIView:0x7f9a07640bb0.width == 414   (active)>",
    "<NSLayoutConstraint:0x604000292e30 'UIViewSafeAreaLayoutGuide-left' H:|-(0)-[UILayoutGuide:0x6040007a0540'UIViewSafeAreaLayoutGuide'](LTR)   (active, names: '|':UIView:0x7f9a07640bb0 )>",
    "<NSLayoutConstraint:0x604000293100 'UIViewSafeAreaLayoutGuide-right' H:[UILayoutGuide:0x6040007a0540'UIViewSafeAreaLayoutGuide']-(0)-|(LTR)   (active, names: '|':UIView:0x7f9a07640bb0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x604000296df0 UIButton:0x7f9a07538760'ADAUGA'.trailing == UILayoutGuide:0x6040007a0540'UIViewSafeAreaLayoutGuide'.trailing   (active)>

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.
2017-10-11 10:37:32.670217+0300 Expense Manager[2853:71957] [LayoutConstraints] 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:0x60000029d290 h=--& v=--& UIButton:0x7f9a07538760'ADAUGA'.midY == 540   (active)>",
    "<NSAutoresizingMaskLayoutConstraint:0x60000029d5b0 h=--& v=--& UIButton:0x7f9a07538760'ADAUGA'.height == 56   (active)>",
    "<NSLayoutConstraint:0x604000294d70 V:[UIButton:0x7f9a07538760'ADAUGA']-(0)-|   (active, names: '|':UIView:0x7f9a07640bb0 )>",
    "<NSLayoutConstraint:0x60000029bbc0 'UIView-Encapsulated-Layout-Height' UIView:0x7f9a07640bb0.height == 736   (active)>",
    "<NSAutoresizingMaskLayoutConstraint:0x60000029b990 h=-&- v=-&- 'UIView-Encapsulated-Layout-Top' UIView:0x7f9a07640bb0.minY == 0   (active, names: '|':UITransitionView:0x7f9a0770b780 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x604000294d70 V:[UIButton:0x7f9a07538760'ADAUGA']-(0)-|   (active, names: '|':UIView:0x7f9a07640bb0 )>

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.

这是一张照片。而不是将该按钮绑定到左侧,右侧和底部,它看起来像this

我有什么方法可以删除我创建的UIViews,或者我可以做些什么来使我的约束恢复正常。

0 个答案:

没有答案