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