1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- //
- // ASProductListImageCell.m
- // Asteria
- //
- // Created by iOS on 2023/6/14.
- //
- #import "ASProductListImageCell.h"
- @implementation ASProductListImageCell
- - (void)setImgStr:(NSString *)imgStr {
- [self.imgV sd_setImageWithURL:[NSURL URLWithString:imgStr] placeholderImage:[UIImage imageNamed:@"product_defualtImg"]];
- }
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- [self loadSubVs];
- }
- return self;
- }
- - (void)loadSubVs {
- self.backgroundColor = UIColor.clearColor;
- self.contentView.backgroundColor = UIColor.clearColor;
-
- [self.contentView addSubview:self.imgV];
- [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.equalTo(self.contentView);
- }];
- }
- - (UIImageView *)imgV {
- if (!_imgV) {
- UIImageView *v = [UIImageView baseImgV];
- v.contentMode = UIViewContentModeScaleAspectFill;
- v.clipsToBounds = true;
- v.layer.cornerRadius = 8;
- v.layer.masksToBounds = true;
- _imgV = v;
- }
- return _imgV;
- }
- @end
|