63 lines
1.7 KiB
Objective-C
63 lines
1.7 KiB
Objective-C
//
|
|
// StartZWPIViewCell.m
|
|
// ProductApp
|
|
//
|
|
// Created by 工作 on 2024/9/23.
|
|
//
|
|
|
|
#import "StartZWPIViewCell.h"
|
|
|
|
|
|
@interface StartZWPIViewCell ()
|
|
///
|
|
@property (nonatomic , strong) UILabel *lbname;
|
|
///
|
|
@property (nonatomic , strong) UIImageView *imgvback;
|
|
@end
|
|
|
|
@implementation StartZWPIViewCell
|
|
|
|
-(id)initWithFrame:(CGRect)frame
|
|
{
|
|
if(self = [super initWithFrame:frame])
|
|
{
|
|
UILabel *lbname = [[UILabel alloc] init];
|
|
[lbname setText:@"《一路有你相伴》"];
|
|
[lbname setTextColor:RGBCOLOR(51, 51, 51)];
|
|
[lbname setTextAlignment:NSTextAlignmentCenter];
|
|
[lbname setFont:[UIFont boldSystemFontOfSize:20]];
|
|
[self addSubview:lbname];
|
|
[lbname mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.top.offset(20);
|
|
make.left.right.equalTo(self);
|
|
make.height.offset(22);
|
|
}];
|
|
_lbname = lbname;
|
|
|
|
UIImageView *imgvback = [[UIImageView alloc] init];
|
|
[imgvback setContentMode:UIViewContentModeScaleAspectFill];
|
|
[self addSubview:imgvback];
|
|
[imgvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.right.equalTo(self);
|
|
make.bottom.equalTo(self).offset(-20);
|
|
make.top.equalTo(lbname.mas_bottom).offset(15);
|
|
}];
|
|
[imgvback.layer setMasksToBounds:YES];
|
|
[imgvback.layer setCornerRadius:20];
|
|
_imgvback = imgvback;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
-(void)setModel:(ExampleCorrectListDataItems *)model
|
|
{
|
|
_model = model;
|
|
self.lbname.text = [Tools isStringnilkong:model.title];
|
|
if(model.input_image.count>0)
|
|
{
|
|
[self.imgvback sd_setImageWithURL:[NSURL URLWithString:model.input_image.firstObject] placeholderImage:nil];
|
|
}
|
|
}
|
|
|
|
@end
|