美文网首页iOS 开发进阶
iOS Masonry随手笔记

iOS Masonry随手笔记

作者: 屈涯 | 来源:发表于2018-11-19 22:56 被阅读5次

    控件右侧对齐另一个控件左侧,使用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随手笔记

        本文链接:https://www.haomeiwen.com/subject/efuzfqtx.html