自动布局的警告调试

<SnapKit.LayoutConstraint:0x7ff912a1ce10@/Users/VENN/Desktop/\U5fae\U535a/VennBlog/\U5fae\U535a01/\U5fae\U535a01/Classes/View/Home/Cell/NWHomeCell.swift#91

Weibo01.NWHomeCellTop:0x7ff912a159a0.top == UITableViewCellContentView:0x7ff912a147e0.top>",

    "<SnapKit.LayoutConstraint:0x7ff912a213f0@/Users/VENN/Desktop/\U5fae\U535a/VennBlog/\U5fae\U535a01/\U5fae\U535a01/Classes/View/Home/Cell/NWHomeCell.swift#91

Weibo01.NWHomeCellTop:0x7ff912a159a0.height == 59.0>",

    "<SnapKit.LayoutConstraint:0x7ff912a21af0@/Users/VENN/Desktop/\U5fae\U535a/VennBlog/\U5fae\U535a01/\U5fae\U535a01/Classes/View/Home/Cell/NWHomeCell.swift#102

UILabel:0x7ff9104a98d0.top == Weibo01.NWHomeCellTop:0x7ff912a159a0.bottom + 12.0>",

    "<SnapKit.LayoutConstraint:0x7ff912a22340@/Users/VENN/Desktop/\U5fae\U535a/VennBlog/\U5fae\U535a01/\U5fae\U535a01/Classes/View/Home/Cell/NWHomeCell.swift#111

Weibo01.NWHomePictureView:0x7ff912051000.top == UILabel:0x7ff9104a98d0.bottom + 12.0>",

    "<SnapKit.LayoutConstraint:0x7ff912a22d00@/Users/VENN/Desktop/\U5fae\U535a/VennBlog/\U5fae\U535a01/\U5fae\U535a01/Classes/View/Home/Cell/NWHomeCell.swift#111

Weibo01.NWHomePictureView:0x7ff912051000.height == 270.0>",

    "<SnapKit.LayoutConstraint:0x7ff912a23630@/Users/VENN/Desktop/\U5fae\U535a/VennBlog/\U5fae\U535a01/\U5fae\U535a01/Classes/View/Home/Cell/NWHomeCell.swift#124

Weibo01.NWHomeCellBottom:0x7ff9104ab450.top == Weibo01.NWHomePictureView:0x7ff912051000.bottom + 12.0>",

    "<SnapKit.LayoutConstraint:0x7ff912a252d0@/Users/VENN/Desktop/\U5fae\U535a/VennBlog/\U5fae\U535a01/\U5fae\U535a01/Classes/View/Home/Cell/NWHomeCell.swift#124

Weibo01.NWHomeCellBottom:0x7ff9104ab450.height == 44.0>",

    "<SnapKit.LayoutConstraint:0x7ff9128b50c0@/Users/VENN/Desktop/\U5fae\U535a/VennBlog/\U5fae\U535a01/\U5fae\U535a01/Classes/View/Home/Cell/NWHomeCell.swift#124

Weibo01.NWHomeCellBottom:0x7ff9104ab450.bottom == UITableViewCellContentView:0x7ff912a147e0.bottom>",

大家看到这一坨东西就是自动布局系统的计算失败 发出警告 我们只看swift#后的内容发现都是跟垂直方向有关系的,这就说明我们在垂直方向的布局出了问题 ,所以只要从上往下就知道那个方向的错误

一般情况下要是约束出了警告大部分情况就是约束加多了 上面这个情况就是 破法 把自动设置cell 的高度去掉

加一个设置高度和预告高度即可 顺便把最后一个控件的向下的约束也去掉 就不会有警告了


转载于:https://my.oschina.net/venn0126/blog/543376

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值