// // LogisticsTimeOutCell.m // FirstLink // // Created by ascii on 16/5/3. // Copyright © 2016年 FirstLink. All rights reserved. // #import "LogisticsTimeOutCell.h" @interface LogisticsTimeOutCell () @property (nonatomic, strong) UILabel *timeOutLabel; @property (nonatomic, strong) UIImageView *tipIcon; @end @implementation LogisticsTimeOutCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier]; if (self) { [self addAllSubViews]; } return self; } - (void)addAllSubViews { [self.contentView addSubview:self.timeOutBtn]; [self.timeOutBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.top.bottom.equalTo(self.contentView); make.right.equalTo(self.contentView).offset(-15); make.width.mas_equalTo(135); }]; [self.timeOutBtn addSubview:self.tipIcon]; [self.tipIcon mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(self.timeOutBtn); make.right.equalTo(self.timeOutBtn); make.size.mas_equalTo(CGSizeMake(17, 17)); }]; [self.timeOutBtn addSubview:self.timeOutLabel]; [self.timeOutLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(self.timeOutBtn); make.right.equalTo(self.tipIcon.mas_left).offset(-5); }]; UIView *line = [UIView new]; line.backgroundColor = UIColorFromRGB(0x666666); [self.timeOutBtn addSubview:line]; [line mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.timeOutLabel); make.top.equalTo(self.timeOutLabel.mas_bottom); make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale); }]; } #pragma mark - Property - (UIButton *)timeOutBtn { if (!_timeOutBtn) { _timeOutBtn = [UIButton buttonWithType:UIButtonTypeCustom]; } return _timeOutBtn; } - (UIImageView *)tipIcon { if (!_tipIcon) { _tipIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"LogisticsTimeOutGuide"]]; } return _tipIcon; } - (UILabel *)timeOutLabel { if (!_timeOutLabel) { _timeOutLabel = [UILabel new]; _timeOutLabel.font = [UIFont systemFontOfSize:14]; _timeOutLabel.textColor = UIColorFromRGB(0x666666); _timeOutLabel.textAlignment = NSTextAlignmentCenter; _timeOutLabel.text = @"了解超时赔付"; } return _timeOutLabel; } @end