1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- //
- // YOUPAIZYUserZiLiaoSHNoDataCell.m
- // VQU
- //
- // Created by 肖浩然的mac on 2021/7/16.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "YOUPAIZYUserZiLiaoSHNoDataCell.h"
- @implementation YOUPAIZYUserZiLiaoSHNoDataCell
- -(instancetype)initWithFrame:(CGRect)frame{
- if (self = [super initWithFrame:frame]) {
- [self youpaifsetSubView];
- }
- return self;
-
- }
- -(void)youpaifsetSubView{
-
- UIView *titleView = [UIView new];
- [self.contentView addSubview:titleView];
- [titleView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.top.mas_equalTo(0);
- make.height.mas_equalTo(43);
- }];
- titleView.backgroundColor = LCBkgColor;
-
- self.youpaiptitleLabel = [[UILabel alloc] init];
- self.youpaiptitleLabel.font = LCBoldFont(14);
- [titleView addSubview:self.youpaiptitleLabel];
- [self.youpaiptitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.mas_equalTo(0);
- make.left.mas_equalTo(14);
-
- }];
-
- UIView *contentView = [UIView new];
- [self.contentView addSubview:contentView];
- [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(titleView.mas_bottom);
- make.left.mas_offset(0);
- make.right.mas_offset(0);
- make.bottom.mas_offset(0.f);
- }];
-
- contentView.backgroundColor = LCBkgColor;
- //分割线
- UIView *viewLine =[UIView new];
- [self addSubview:viewLine];
- [viewLine mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(14);
- make.right.mas_equalTo(-14);
- make.bottom.mas_equalTo(0);
- make.height.mas_equalTo(0.5f);
- }];
- viewLine.backgroundColor =HexColorFromRGB(0x28262D);
-
- UILabel *hintLabel = [UILabel new];
- [contentView addSubview:hintLabel];
- [hintLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.mas_equalTo(0);
- make.top.mas_equalTo(0);
- }];
- hintLabel.text = @"还没有人守护Ta";
- hintLabel.font = [UIFont systemFontOfSize:14];
- hintLabel.textColor = HexColorFromRGB(0x6C6B70);
- //庇护按钮
- _youpaipshouhuBtn = [UIButton new];
- [contentView addSubview:_youpaipshouhuBtn];
- [_youpaipshouhuBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(hintLabel.mas_bottom).offset(8);
- make.centerX.mas_equalTo(0);
- make.size.mas_equalTo(CGSizeMake(ScaleSize(77), 22));
- }];
- [_youpaipshouhuBtn setBackgroundImage:[LCTools ColorImage:CGSizeMake(ScaleSize(77), 22) FromColors:@[ZYGradientOneColor,ZYGradientTwoColor] ByGradientType:1] forState:UIControlStateNormal];
- [_youpaipshouhuBtn setTitle:@"我要守护" forState:UIControlStateNormal];
- _youpaipshouhuBtn.titleLabel.font = [UIFont systemFontOfSize:12];
- [_youpaipshouhuBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- _youpaipshouhuBtn.layer.cornerRadius = 11;
- _youpaipshouhuBtn.layer.masksToBounds = YES;
- [_youpaipshouhuBtn addTarget:self action:@selector(youpaifshouhuBtnClick) forControlEvents:UIControlEventTouchUpInside];
- }
- -(void)youpaifshouhuBtnClick{
- if (self.youpaipdidClickSh) {
- self.youpaipdidClickSh();
- }
-
- }
- -(void)setYoupaipdataArr:(NSArray *)dataArr{
- _youpaipdataArr = dataArr;
- self.youpaiptitleLabel.attributedText = [LCTools setRichTextWithTitle:@"守护" subTitle:[NSString stringWithFormat:@"(%lu人)",(unsigned long)self.youpaipdataArr.count] titleColor:[UIColor whiteColor] subTitleColor:HexColorFromRGB(0x9F9DA5) titleFontSize:14 subTitleFontSize:12];
-
- }
- @end
|