//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];
网友评论