美文网首页
Masonry设置HeaderView

Masonry设置HeaderView

作者: 丶小杨_ | 来源:发表于2019-09-28 14:26 被阅读0次
        //masonry 设置HeaderView
        UIView * bgView= [[UIView alloc]init];
        [bgView addSubview:self.headerV];
        [self.headerV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_equalTo(bgView);
        }];
        
        // 网络加载 --- 创建带标题的图片轮播器
        [self.headerV addSubview:self.cycleV];
        [self.cycleV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.equalTo(self.headerV);
            make.height.mas_equalTo(bannerH);
        }];
        
        
        [self.headerV mas_updateConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.cycleV.mas_bottom).offset(10);
        }];
    
        self.tableView.tableHeaderView = bgView;
        [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.width.equalTo(self.tableView);
        }];
    
        [self.tableView layoutIfNeeded];
    
    

    相关文章

      网友评论

          本文标题:Masonry设置HeaderView

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