美文网首页
ScrollView自适应Masnory

ScrollView自适应Masnory

作者: follow_er | 来源:发表于2017-10-12 09:09 被阅读12次

    ScrollView自适应Masnory 可以展示, 但是不能接收点击

        UIScrollView *vScroll = [[UIScrollView alloc] init];
        vScroll.showsVerticalScrollIndicator = NO;
        vScroll.backgroundColor = kColorBackground0;
        [self addSubview:vScroll];
        [vScroll mas_makeConstraints:^(MASConstraintMaker *make) {
            // self 有frame的View
              make.edges.equalTo(self);
        }];
        
        UIView *vContent = [[UIView alloc] init];
        [vScroll addSubview:vContent];
        [vContent mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(vScroll);
           //  竖向滑动用
           make.width.equalTo(vScroll);
          //  横向滑动用
          //make.height.equalTo(vScroll);
        }];
        // 创建时间
        _labCreatTime = [[UILabel alloc] init];
        _labCreatTime.text = @"xxx于YYYY-MM-DD HH:SS:MM 创建该任务";
        _labCreatTime.font = kFontSize(14);
        [vContent addSubview:_labCreatTime];
        [_labCreatTime mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(vContent);
            make.top.equalTo(vContent).with.offset(5);
            make.height.mas_equalTo(20);
        }];
    
        _labAccomplishTime = [[UILabel alloc] init];
        _labAccomplishTime.font = kFontSize(16);
        [vContent addSubview:_labAccomplishTime];
        [_labAccomplishTime mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(vContent);
            make.top.equalTo(view.mas_bottom).with.offset(10);
            make.height.mas_equalTo(50);
            make.bottom.equalTo(vContent);
        }];
    
    

    相关文章

      网友评论

          本文标题:ScrollView自适应Masnory

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