zoukankan      html  css  js  c++  java
  • ScrollView不设置contentSize属性依然也可以作为底层滚动View(使用masonry设置scrollView的contentSize)

    第一步

    //下层的scroolView
    self.baseScrollView = [[UIScrollView alloc] init];
    self.baseScrollView.delegate = self;
    self.baseScrollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    self.baseScrollView.scrollEnabled = YES;
    self.baseScrollView.backgroundColor = [UIColor colorWithHexString:WSFConstants_Color_BackgoundMainColor];
    UIGestureRecognizer *gestur = [[UIGestureRecognizer alloc]init];
    gestur.delegate = self;
    [self.baseScrollView addGestureRecognizer:gestur];
    [self.view addSubview: self.baseScrollView];
    //contentView UIView *contentView = [[UIView alloc]init]; [self.baseScrollView addSubview:contentView]; [contentView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self.baseScrollView); make.width.equalTo(self.baseScrollView); }];

    第二步

    //content
    [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(telephoneBtn.mas_bottom).offset(70);
    }];

    第三步

    <UIScrollViewDelegate>
  • 相关阅读:
    Web大前端面试题-Day12
    Web大前端面试题-Day11
    每天刷Web面试题(前10天汇总)
    Web大前端面试题-Day10
    Web大前端面试题-Day9
    Web大前端面试题-Day8
    Web大前端面试题-Day5
    Web大前端面试题-Day7
    Web大前端面试题-Day6
    php获取时间是星期几
  • 原文地址:https://www.cnblogs.com/cchHers/p/11162850.html
Copyright © 2011-2022 走看看