活动改造
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// PIRoomActivityWebCell.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/11/15.
|
||||
//
|
||||
|
||||
#import "PIRoomActivityWebCell.h"
|
||||
@interface PIRoomActivityWebCell()
|
||||
@property(nonatomic,strong) NetImageView *bgImageView;
|
||||
@end
|
||||
@implementation PIRoomActivityWebCell
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
self.contentView.backgroundColor = [UIColor clearColor];
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[self.contentView addSubview:self.bgImageView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
-(void)setPi_isChoose:(BOOL)pi_isChoose{
|
||||
_pi_isChoose = pi_isChoose;
|
||||
_bgImageView.layer.borderWidth = _pi_isChoose ? 2 : 0;
|
||||
}
|
||||
-(void)setInfoModel:(ActivityInfoModel *)infoModel{
|
||||
_infoModel = infoModel;
|
||||
_bgImageView.imageUrl = _infoModel.bannerPic;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (NetImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init]; config.placeHolder = [UIImageConstant defalutBannerPlaceholder];
|
||||
_bgImageView = [[NetImageView alloc]initWithConfig:config];
|
||||
_bgImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_bgImageView.layer.cornerRadius = kGetScaleWidth(4);
|
||||
_bgImageView.layer.masksToBounds = YES;
|
||||
_bgImageView.layer.borderWidth = 0;
|
||||
_bgImageView.layer.borderColor = UIColorFromRGB(0x9168FA).CGColor;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
@end
|
Reference in New Issue
Block a user