// // YXEmptyView.m // Temperature // // Created by TC on 2025/4/23. // #import "YXEmptyView.h" @implementation YXEmptyView - (instancetype)init { self = [super init]; if (self) { self.backgroundColor = UIColor.whiteColor; [self setItemSubViews]; } return self; } -(void)setItemSubViews { UIImageView *picView = [[UIImageView alloc]init]; [self addSubview:picView]; [picView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(@20); make.centerX.equalTo(self.mas_centerX); make.width.equalTo(@150); make.height.equalTo(@150); }]; self.picImgView = picView; UILabel *textLabel = [[UILabel alloc]init]; textLabel.font = [UIFont systemFontOfSize:14]; textLabel.textAlignment = NSTextAlignmentCenter; textLabel.textColor = [UIColor colorWithHexString:@"#333333"]; [self addSubview:textLabel]; [textLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.mas_centerX); make.top.equalTo(picView.mas_bottom).offset(50); make.width.equalTo(@150); make.height.equalTo(@30); }]; self.textLabel = textLabel; } /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code } */ @end