iOS Masonry随手笔记

控件右侧对齐另一个控件左侧,使用mas_left

    YHWeakify(self);
    [self.ownerTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.top.mas_equalTo(self).mas_offset(15);
    }];
    [self.leftLine mas_makeConstraints:^(MASConstraintMaker *make) {
        YHStrongify(self);
        make.right.mas_equalTo(self.ownerTitleLabel.mas_left).mas_offset(-7);
        make.centerY.mas_equalTo(self.ownerTitleLabel);
        make.width.mas_equalTo(20);
        make.height.mas_equalTo(1);
    }];
    [self.rightLine mas_makeConstraints:^(MASConstraintMaker *make) {
        YHStrongify(self);
        make.left.mas_equalTo(self.ownerTitleLabel.mas_right).mas_offset(7);
        make.centerY.mas_equalTo(self.ownerTitleLabel);
        make.width.mas_equalTo(20);
        make.height.mas_equalTo(1);
    }];

你可能感兴趣的:(iOS Masonry随手笔记)