123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- //
- // FKHomeOrderHeaderCell.m
- // FirstLink
- //
- // Created by ascii on 16/8/12.
- // Copyright © 2016年 FirstLink. All rights reserved.
- //
- #import "FKHomeOrderHeaderCell.h"
- @interface FKHomeOrderHeaderCell ()
- @property (nonatomic, strong) UILabel *titleLabel;
- @property (nonatomic, strong) UILabel *subTitleLabel;
- @property (nonatomic, strong) UIView *separatorLine;
- @property (nonatomic, strong) UIImageView *detailView;
- @end
- @implementation FKHomeOrderHeaderCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- [self addAllSubViews];
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- return self;
- }
- - (void)addAllSubViews {
- [self.contentView addSubview:self.titleLabel];
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.contentView).with.offset(15);
- make.centerY.equalTo(self.contentView);
- }];
-
- [self.contentView addSubview:self.detailView];
- [self.detailView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.equalTo(self.contentView).with.offset(-15);
- make.centerY.equalTo(self.contentView);
- make.size.mas_equalTo(CGSizeMake(20, 20));
- }];
-
- [self.contentView addSubview:self.subTitleLabel];
- [self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.equalTo(self.detailView.mas_left).offset(-5);
- make.centerY.equalTo(self.contentView);
- }];
-
- [self.contentView addSubview:self.separatorLine];
- [self.separatorLine mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.bottom.right.equalTo(self.contentView);
- make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale);
- }];
- }
- #pragma mark -
- - (UILabel *)titleLabel {
- if (!_titleLabel) {
- _titleLabel = [[UILabel alloc] init];
- _titleLabel.textColor = UIColorFromRGB(0x666666);
- _titleLabel.font = [UIFont systemFontOfSize:13];
- _titleLabel.text = @"全部订单";
- }
- return _titleLabel;
- }
- - (UILabel *)subTitleLabel {
- if (!_subTitleLabel) {
- _subTitleLabel = [[UILabel alloc] init];
- _subTitleLabel.textColor = UIColorFromRGB(0x999999);
- _subTitleLabel.font = [UIFont systemFontOfSize:13];
- _subTitleLabel.textAlignment = NSTextAlignmentRight;
- _subTitleLabel.text = @"查看全部订单";
- }
- return _subTitleLabel;
- }
- - (UIImageView*)detailView {
- if (!_detailView) {
- _detailView = [[UIImageView alloc] init];
- _detailView.image = [UIImage imageNamed:@"Cell_More_Icon"];
- }
- return _detailView;
- }
- - (UIView*)separatorLine {
- if (!_separatorLine) {
- _separatorLine = [[UIView alloc] init];
- _separatorLine.backgroundColor = UIColorFromRGB(0xe5e5e5);
- }
- return _separatorLine;
- }
- @end
|