如何阅读错误行&检测错误的起源"无法同时满足约束"警告

时间:2017-07-12 09:12:48

标签: ios iphone swift storyboard constraints

以下列表中的至少一个约束可能是您不想要的约束。

试试这个:

  1. 看看每个约束条件并试着找出你不期望的东西;
  2. 找到添加了不需要的约束或约束的代码并进行修复。
  3. 请告诉我如何阅读这些错误/警告行,我的意思是如何检测问题的根源

    (
    "<NSLayoutConstraint:0x60800009e370 UIView:0x7fdc38d1ac50.height == 1   (active)>",
    "<NSLayoutConstraint:0x60800009e410 UILabel:0x7fdc38d1adf0'1 hour ago'.height == 20   (active)>",
    "<NSLayoutConstraint:0x61000009d880 UIButton:0x7fdc38e39b80.height == 25   (active)>",
    "<NSLayoutConstraint:0x60800009dc90 UICollectionView:0x7fdc39832600.height == 120   (active)>",
    "<NSLayoutConstraint:0x60800009e6e0 V:|-(16)-[UILabel:0x7fdc38e39f70'RFA(DEB/TACE) recommended']   (active, names: '|':UIView:0x7fdc38d1a8c0 )>",
    "<NSLayoutConstraint:0x60800009e820 V:[UILabel:0x7fdc38e39f70'RFA(DEB/TACE) recommended']-(8)-[UILabel:0x7fdc3ba068b0'Asking for Self, Female, ...']   (active)>",
    "<NSLayoutConstraint:0x60800009e910 V:[UILabel:0x7fdc3ba068b0'Asking for Self, Female, ...']-(8)-[UILabel:0x7fdc3ba18770'kindly help me doctor rec...']   (active)>",
    "<NSLayoutConstraint:0x60800009e960 V:[UILabel:0x7fdc3ba18770'kindly help me doctor rec...']-(16)-[UICollectionView:0x7fdc39832600]   (active)>",
    "<NSLayoutConstraint:0x60800009eaf0 V:[UICollectionView:0x7fdc39832600]-(16)-[UILabel:0x7fdc38d1adf0'1 hour ago']   (active)>",
    "<NSLayoutConstraint:0x60800009eb90 V:[UILabel:0x7fdc38d1adf0'1 hour ago']-(8)-[UIView:0x7fdc38d1ac50]   (active)>",
    "<NSLayoutConstraint:0x60800009ecd0 V:[UIButton:0x7fdc38e39b80]-(16)-[UIButton:0x7fdc3ba184a0'Post Answer']   (active)>",
    "<NSLayoutConstraint:0x60800009ed20 V:[UIButton:0x7fdc3ba184a0'Post Answer']-(16)-|   (active, names: '|':UIView:0x7fdc38d1a8c0 )>",
    "<NSLayoutConstraint:0x60800009ee10 V:[UIView:0x7fdc38d1ac50]-(8)-[UIButton:0x7fdc38e39b80]   (active)>",
    "<NSLayoutConstraint:0x60800009ef50 V:|-(8)-[UIView:0x7fdc38d1a8c0]   (active, names: '|':UITableViewCellContentView:0x7fdc38d1a6f0 )>",
    "<NSLayoutConstraint:0x60800009efa0 V:[UIView:0x7fdc38d1a8c0]-(8)-|   (active, names: '|':UITableViewCellContentView:0x7fdc38d1a6f0 )>",
    "<NSLayoutConstraint:0x60800009f900 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7fdc38d1a6f0.height == 170   (active)>"
    

    将尝试通过违反约束来恢复

0 个答案:

没有答案