AutoLayout: removeFromSuperview / removeConstraints throws exception and crashes hard

后端 未结 13 2231
谎友^
谎友^ 2020-11-27 11:05

We use auto layout constraints selectively, primarily to position labels in relation to editable field elements (UITextView, UITextField, typically). However, since impleme

13条回答
  •  野性不改
    2020-11-27 11:28

    In my case it was a proportional width constraint with 8:9 multiplier. I changed it to 7:9 and it worked.

    BTW the easiest way to find a constraint is to start removing views from view controller. Do it using binary algorithm :) removing half views, then half of the half that makes app crash, etc.

提交回复
热议问题