// // YXBottomItemView.m // Temperature // // Created by z on 2025/1/20. // #import "YXBottomItemView.h" @implementation YXBottomItemView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; 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.centerX.equalTo(self.mas_centerX); make.top.equalTo(@10); make.width.equalTo(@30); make.height.equalTo(@30); }]; self.picImgView = picView; UILabel *textLabel = [[UILabel alloc]init]; textLabel.font = [UIFont systemFontOfSize:11]; 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); make.width.equalTo(self.mas_width); make.bottom.equalTo(@0); }]; 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