Unable to simultaneously satisfy constraints.

在進行版本的迭代更新時,新功能需求須要對主頁面的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下),一樣須要咱們把回傳數據等操做放到主線程來操做。

相關文章
相關標籤/搜索