1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // LFWFindTopCollectionViewCell.m
- // YouHuiProject
- //
- // Created by xiaoxi on 2018/1/19.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "LFWFindTopCollectionViewCell.h"
- @implementation LFWFindTopCollectionViewCell
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- self.layer.cornerRadius = 3;
- self.layer.masksToBounds = YES;
- [self initSubviews];
- }
- return self;
- }
- - (void)initSubviews {
- [self.contentView.layer addSublayer:self.pictureLayer];
- }
- - (void)setModel:(LFWFindHotSearchModel *)model {
- _model = model;
- [self.pictureLayer yy_setImageWithURL:[NSURL URLWithString:model.icon] options:YYWebImageOptionProgressiveBlur | YYWebImageOptionSetImageWithFadeAnimation];
- }
- #pragma mark - lazy
- - (CALayer *)pictureLayer {
- if (!_pictureLayer) {
- _pictureLayer = [CALayer layer];
- _pictureLayer.frame = CGRectMake(0, 0, FITSIZE(108), FITSIZE(75));
- _pictureLayer.backgroundColor = [UIColor clearColor].CGColor;
- }
- return _pictureLayer;
- }
- @end
|