zoukankan      html  css  js  c++  java
  • 自动布局又出问题-HPPGCTableViewCell

    [self.firstComment mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.summaryLbl.mas_bottom).offset(commentPadding);
            make.left.equalTo(commentLeftMargin);
        }];

    if (feedData.summary.length) {
            [self.firstComment mas_updateConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.summaryLbl.mas_bottom).offset(commentPadding);
            }];
        }else {
            [self.firstComment mas_updateConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.summaryLbl.mas_bottom).offset(-5);
            }];
        }

    上面的写法可以,下面的写法约束就会报错, 而且summaryLb也显示不全,mas_update 只能改值,不能改约束依赖的对象

    if (feedData.summary.length) {
            [self.firstComment mas_updateConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.summaryLbl.mas_bottom).offset(commentPadding);
            }];
        }else {
            [self.firstComment mas_updateConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.likeBtn.mas_bottom).offset(-5);
            }];
        }

  • 相关阅读:
    老大叔开博感想
    模板
    Codeforces Round #685 (Div. 2) 题解
    CF830E Perpetual Motion Machine 题解
    THUWC2020游记
    数论
    后缀数组学习笔记
    Codeforces Round #466 (Div. 2)
    博客停写,搬家到www.54kaikai.com
    lda 主题模型--TOPIC MODEL--Gibbslda++结果分析
  • 原文地址:https://www.cnblogs.com/tufei7/p/7880727.html
Copyright © 2011-2022 走看看