123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- //
- // YPPhotoGroupCell.m
- // YPPhotoDemo
- //
- // Created by YueWen on 16/7/13.
- // Copyright © 2017年 YueWen. All rights reserved.
- //
- #import "RITLPhotosGroupCell.h"
- #import "NSBundle+RITLPhotos.h"
- #import "RITLKit.h"
- #import "Masonry.h"
- //static NSString *const RITLGroupTableViewControllerRightArrowImageName = @"RITLPhotos.bundle/ritl_arrow_right";
- @implementation RITLPhotosGroupCell
- @synthesize imageView = _imageView,titleLabel = _titleLabel;
- -(void)dealloc
- {
- #ifdef RITLDebug
- // NSLog(@"YPPhotoGroupCell Dealloc");
- #endif
- }
- -(void)prepareForReuse
- {
- [super prepareForReuse];
- _imageView.image = nil;
- _titleLabel.text = @"";
- }
- -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
- {
- [self photoGroupCellWillLoad];
- }
-
- return self;
- }
- - (void)awakeFromNib
- {
- [super awakeFromNib];
- // Initialization code
- [self photoGroupCellWillLoad];
- }
- - (void)photoGroupCellWillLoad
- {
- [self addSubImageView];
- [self addSubTitleLabel];
- [self addSubArrowImageView];
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- #pragma mark - AddSubviews
- - (void)addSubImageView
- {
- _imageView = [[UIImageView alloc]init];
- _imageView.contentMode = UIViewContentModeScaleAspectFill;
- _imageView.clipsToBounds = true;
-
- [self.contentView addSubview:_imageView];
-
- [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.top.mas_equalTo(0);
- make.bottom.mas_equalTo(0);
- make.leading.mas_equalTo(10);
- make.width.equalTo(self.imageView.mas_height);
-
- }];
- }
- - (void)addSubTitleLabel
- {
- _titleLabel = [[UILabel alloc]init];
- _titleLabel.font = [UIFont systemFontOfSize:15];
-
- [self.contentView addSubview:_titleLabel];
-
- [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.centerY.equalTo(self.contentView.mas_centerY);
- make.left.equalTo(self.imageView.mas_right).offset(10);
- make.right.equalTo(self.contentView).offset(-10);
-
- }];
-
- }
- - (void)addSubArrowImageView
- {
- _arrowImageView = [[UIImageView alloc]init];
- _arrowImageView.image = /*RITLGroupTableViewControllerRightArrowImageName.ritl_image*/NSBundle.ritl_arrow_right;
-
- [self.contentView addSubview:_arrowImageView];
-
- [_arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.right.inset(15);
- make.centerY.offset(0);
- make.size.mas_equalTo(CGSizeMake(15, 15));
- }];
-
- }
- @end
|