Açıklama Yok

FKHomeOrderHeaderCell.m 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //
  2. // FKHomeOrderHeaderCell.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 16/8/12.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKHomeOrderHeaderCell.h"
  9. @interface FKHomeOrderHeaderCell ()
  10. @property (nonatomic, strong) UILabel *titleLabel;
  11. @property (nonatomic, strong) UILabel *subTitleLabel;
  12. @property (nonatomic, strong) UIView *separatorLine;
  13. @property (nonatomic, strong) UIImageView *detailView;
  14. @end
  15. @implementation FKHomeOrderHeaderCell
  16. - (void)awakeFromNib {
  17. [super awakeFromNib];
  18. // Initialization code
  19. }
  20. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  21. [super setSelected:selected animated:animated];
  22. // Configure the view for the selected state
  23. }
  24. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  25. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  26. if (self) {
  27. [self addAllSubViews];
  28. self.selectionStyle = UITableViewCellSelectionStyleNone;
  29. }
  30. return self;
  31. }
  32. - (void)addAllSubViews {
  33. [self.contentView addSubview:self.titleLabel];
  34. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  35. make.left.equalTo(self.contentView).with.offset(15);
  36. make.centerY.equalTo(self.contentView);
  37. }];
  38. [self.contentView addSubview:self.detailView];
  39. [self.detailView mas_makeConstraints:^(MASConstraintMaker *make) {
  40. make.right.equalTo(self.contentView).with.offset(-15);
  41. make.centerY.equalTo(self.contentView);
  42. make.size.mas_equalTo(CGSizeMake(20, 20));
  43. }];
  44. [self.contentView addSubview:self.subTitleLabel];
  45. [self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  46. make.right.equalTo(self.detailView.mas_left).offset(-5);
  47. make.centerY.equalTo(self.contentView);
  48. }];
  49. [self.contentView addSubview:self.separatorLine];
  50. [self.separatorLine mas_makeConstraints:^(MASConstraintMaker *make) {
  51. make.left.bottom.right.equalTo(self.contentView);
  52. make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale);
  53. }];
  54. }
  55. #pragma mark -
  56. - (UILabel *)titleLabel {
  57. if (!_titleLabel) {
  58. _titleLabel = [[UILabel alloc] init];
  59. _titleLabel.textColor = UIColorFromRGB(0x666666);
  60. _titleLabel.font = [UIFont systemFontOfSize:13];
  61. _titleLabel.text = @"全部订单";
  62. }
  63. return _titleLabel;
  64. }
  65. - (UILabel *)subTitleLabel {
  66. if (!_subTitleLabel) {
  67. _subTitleLabel = [[UILabel alloc] init];
  68. _subTitleLabel.textColor = UIColorFromRGB(0x999999);
  69. _subTitleLabel.font = [UIFont systemFontOfSize:13];
  70. _subTitleLabel.textAlignment = NSTextAlignmentRight;
  71. _subTitleLabel.text = @"查看全部订单";
  72. }
  73. return _subTitleLabel;
  74. }
  75. - (UIImageView*)detailView {
  76. if (!_detailView) {
  77. _detailView = [[UIImageView alloc] init];
  78. _detailView.image = [UIImage imageNamed:@"Cell_More_Icon"];
  79. }
  80. return _detailView;
  81. }
  82. - (UIView*)separatorLine {
  83. if (!_separatorLine) {
  84. _separatorLine = [[UIView alloc] init];
  85. _separatorLine.backgroundColor = UIColorFromRGB(0xe5e5e5);
  86. }
  87. return _separatorLine;
  88. }
  89. @end