48 lines
1.3 KiB
Objective-C
48 lines
1.3 KiB
Objective-C
//
|
|
// PIRoomActivityChoosePlayCell.m
|
|
// YuMi
|
|
//
|
|
// Created by duoban on 2024/2/20.
|
|
//
|
|
|
|
#import "PIRoomActivityChoosePlayCell.h"
|
|
@interface PIRoomActivityChoosePlayCell()
|
|
@property(nonatomic,strong) NetImageView *playIconView;
|
|
@end
|
|
@implementation PIRoomActivityChoosePlayCell
|
|
-(instancetype)initWithFrame:(CGRect)frame{
|
|
self = [super initWithFrame:frame];
|
|
if(self){
|
|
[self installUI];
|
|
[self installConstraints];
|
|
}
|
|
return self;
|
|
}
|
|
- (void)setImageUrl:(NSString *)imageUrl{
|
|
_imageUrl = imageUrl;
|
|
_playIconView.image = nil;
|
|
[_playIconView loadImageWithUrl:_imageUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
|
|
self.playIconView.image = image;
|
|
}];
|
|
}
|
|
-(void)installUI{
|
|
self.contentView.backgroundColor = UIColorRGBAlpha(0x727272, 0.6);
|
|
self.contentView.layer.cornerRadius = 7;
|
|
self.contentView.layer.masksToBounds = YES;
|
|
[self.contentView addSubview:self.playIconView];
|
|
}
|
|
-(void)installConstraints{
|
|
[self.playIconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.width.height.mas_equalTo(43);
|
|
make.center.equalTo(self.contentView);
|
|
}];
|
|
}
|
|
#pragma mark - 懒加载
|
|
- (NetImageView *)playIconView{
|
|
if(!_playIconView){
|
|
_playIconView = [NetImageView new];
|
|
}
|
|
return _playIconView;
|
|
}
|
|
@end
|