在进行版本的迭代更新时,新功能需求须要对主页面的UI进行从新的布局,可是,报了错误,出了好多约束方面的问题:ios
Unable to simultaneously satisfy constraints.async
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) 布局
(this
"<NSLayoutConstraint:0x8c67c10 V:[UIButton:0x8c67320]-(2)-| (Names: '|':UIView:0x8c65ad0 )>",spa
"<NSAutoresizingMaskLayoutConstraint:0x8e166b0 h=--& v=--& UIButton:0x8c67320.midY ==>",线程
"<NSAutoresizingMaskLayoutConstraint:0x8e166e0 h=--& v=--& V:[UIButton:0x8c67320(0)]>",debug
"<NSAutoresizingMaskLayoutConstraint:0x8e130d0 h=-&- v=-&- UIView:0x8c65ad0.height == PicCollectionViewCell:0x8c65a00.height>",code
"<NSLayoutConstraint:0x8e13710 'UIView-Encapsulated-Layout-Height' V:[PicCollectionViewCell:0x8c65a00(100)]>"get
)it
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x8c67c10 V:[UIButton:0x8c67320]-(2)-| (Names: '|':UIView:0x8c65ad0 )>
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.
总的来讲,出现这样的问题,有多是自己的约束问题,固然也多是忘记设置属性
self.automaticallyAdjustsScrollViewInsets = NO(也可能不须要);同时在iOS9下,咱们主界面更新UI须要放到主线程中来进行操做,若是不肯定,能够打印下当前的线程来肯定:
dispatch_async(dispatch_get_main_queue(), ^{
//更新UI
});
若是界面涉及到js交互回调传值的状况(ios 9下),一样须要咱们把回传数据等操做放到主线程来操做。