123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // XYNewWithdrawAmountItemCollectionViewCell.m
- // Starbuds
- //
- // Created by 翟玉磊 on 2020/11/24.
- // Copyright © 2020 翟玉磊. All rights reserved.
- //
- #import "XYNewWithdrawAmountItemCollectionViewCell.h"
- #import "XYNewWithdrawAmountItemModel.h"
- @interface XYNewWithdrawAmountItemCollectionViewCell ()
- @property (nonatomic, strong) UILabel *contentLabel;
- @property (nonatomic, strong) UIImageView *selectedImageView;
- @end
- @implementation XYNewWithdrawAmountItemCollectionViewCell
- - (void)configureModel:(XYNewWithdrawAmountItemModel *)model {
- self.contentLabel.text = model.amount;
-
- if (model.selected) {
- [self.contentLabel addViewBorder:Color_TextRed redian:4];
- }else {
- [self.contentLabel addViewBorder:Color_line redian:4];
- }
- self.selectedImageView.hidden = !model.selected;
- }
- - (instancetype)initWithFrame:(CGRect)frame
- {
- self = [super initWithFrame:frame];
- if (self) {
- [self setupUI];
- }
- return self;
- }
- - (void)setupUI {
- [self.contentView addSubview:self.contentLabel];
- [self.contentView addSubview:self.selectedImageView];
-
- [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.equalTo(self.contentView);
- }];
- [self.selectedImageView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.bottom.equalTo(self.contentLabel);
- make.width.height.equalTo(@18.0f);
- }];
-
- [self.contentLabel addViewBorder:Color_line redian:4];
- }
- #pragma mark — Getter
- - (UILabel *)contentLabel {
- if (!_contentLabel) {
- _contentLabel = [UILabel createLabelTextColor:Color_Nakaguro fount:Font(14)];
- _contentLabel.textAlignment = NSTextAlignmentCenter;
- }
- return _contentLabel;
- }
- - (UIImageView *)selectedImageView {
- if (!_selectedImageView) {
- _selectedImageView = [UIImageView new];
- _selectedImageView.image = ImageNamed(@"icon_wallet_amount_select");
- }
- return _selectedImageView;
- }
- @end
|