123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // XYPersonalContentNormalItemCollectionViewCell.m
- // TianYou
- //
- // Created by 翟玉磊 on 2021/7/21.
- //
- #import "XYPersonalContentNormalItemCollectionViewCell.h"
- #import "XYPersonalCenterListModel.h"
- @interface XYPersonalContentNormalItemCollectionViewCell ()
- @property (nonatomic, strong) UIImageView *contentImageView;
- @property (nonatomic, strong) UILabel *contentLabel;
- @end
- @implementation XYPersonalContentNormalItemCollectionViewCell
- - (void)configureModel:(XYPersonalCenterListModel *)model {
- self.contentImageView.image = ImageNamed(model.iconName);
- self.contentLabel.text = model.title;
- }
- - (instancetype)initWithFrame:(CGRect)frame {
- if (self = [super initWithFrame:frame]) {
-
- [self setupUI];
- }
- return self;
- }
- - (void)setupUI {
- [self.contentView addSubview:self.contentImageView];
- [self.contentView addSubview:self.contentLabel];
-
- [self.contentImageView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.equalTo(self.contentView);
- make.top.equalTo(self.contentView).offset(11.0f);
- make.width.height.equalTo(@24.0f);
- }];
- [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.equalTo(self.contentView);
- make.top.equalTo(self.contentImageView.mas_bottom).offset(4.0f);
- make.height.equalTo(@17.0f);
- }];
- }
- #pragma mark — Getter
- - (UIImageView *)contentImageView {
- if (!_contentImageView) {
- _contentImageView = [UIImageView new];
- }
- return _contentImageView;
- }
- - (UILabel *)contentLabel {
- if (!_contentLabel) {
- _contentLabel = [UILabel createLabelTextColor:Color_Nakaguro fount:Font(12)];
- _contentLabel.textAlignment = NSTextAlignmentCenter;
- }
- return _contentLabel;
- }
- @end
|