UIScrollView自适应高度

 UIScrollView *scrollView = [[UIScrollView alloc]init];

    scrollView.showsHorizontalScrollIndicator=NO;
    scrollView.showsVerticalScrollIndicator = NO;
    [self addSubview:scrollView];
    [scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.mas_equalTo(0);
        make.width.mas_equalTo(Screen_Width);
    }];
    UIView *contentView = [[UIView alloc]init];
    [scrollView addSubview:contentView];
    [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
       make.left.top.bottom.mas_equalTo(0);
        make.width.mas_equalTo(Screen_Width);
        
    }];

 [contentView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(groupLabel).offset(90*kSCALE_6S);
    }];

你可能感兴趣的:(UIScrollView自适应高度)