// // HomePageADCustomCell.m // LN_School // // Created by 张嵘 on 2019/7/25. // Copyright © 2019 Danson. All rights reserved. // #import "HomePageADCustomCell.h" @interface HomePageADCustomCell () @end @implementation HomePageADCustomCell #pragma mark - Life Cycle - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = UIColor.whiteColor; [self addSubview:self.imageView]; } return self; } - (void)layoutSubviews { [super layoutSubviews]; [_imageView mas_makeConstraints:^(MASConstraintMaker *make) { make.center.mas_equalTo(self); make.size.mas_equalTo(CGSizeMake(self.bounds.size.width - 20, self.bounds.size.height - 20)); }]; } #pragma mark - Lazy Load - (UIImageView *)imageView { if (!_imageView) { _imageView = [[UIImageView alloc] initWithFrame:self.frame]; _imageView.layer.cornerRadius = 5; _imageView.clipsToBounds = YES; } return _imageView; } @end