Aucune description

LogisticsTimeOutCell.m 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // LogisticsTimeOutCell.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 16/5/3.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "LogisticsTimeOutCell.h"
  9. @interface LogisticsTimeOutCell ()
  10. @property (nonatomic, strong) UILabel *timeOutLabel;
  11. @property (nonatomic, strong) UIImageView *tipIcon;
  12. @end
  13. @implementation LogisticsTimeOutCell
  14. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  15. self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
  16. if (self) {
  17. [self addAllSubViews];
  18. }
  19. return self;
  20. }
  21. - (void)addAllSubViews {
  22. [self.contentView addSubview:self.timeOutBtn];
  23. [self.timeOutBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  24. make.top.bottom.equalTo(self.contentView);
  25. make.right.equalTo(self.contentView).offset(-15);
  26. make.width.mas_equalTo(135);
  27. }];
  28. [self.timeOutBtn addSubview:self.tipIcon];
  29. [self.tipIcon mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.centerY.equalTo(self.timeOutBtn);
  31. make.right.equalTo(self.timeOutBtn);
  32. make.size.mas_equalTo(CGSizeMake(17, 17));
  33. }];
  34. [self.timeOutBtn addSubview:self.timeOutLabel];
  35. [self.timeOutLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  36. make.centerY.equalTo(self.timeOutBtn);
  37. make.right.equalTo(self.tipIcon.mas_left).offset(-5);
  38. }];
  39. UIView *line = [UIView new];
  40. line.backgroundColor = UIColorFromRGB(0x666666);
  41. [self.timeOutBtn addSubview:line];
  42. [line mas_makeConstraints:^(MASConstraintMaker *make) {
  43. make.left.right.equalTo(self.timeOutLabel);
  44. make.top.equalTo(self.timeOutLabel.mas_bottom);
  45. make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale);
  46. }];
  47. }
  48. #pragma mark - Property
  49. - (UIButton *)timeOutBtn {
  50. if (!_timeOutBtn) {
  51. _timeOutBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  52. }
  53. return _timeOutBtn;
  54. }
  55. - (UIImageView *)tipIcon {
  56. if (!_tipIcon) {
  57. _tipIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"LogisticsTimeOutGuide"]];
  58. }
  59. return _tipIcon;
  60. }
  61. - (UILabel *)timeOutLabel {
  62. if (!_timeOutLabel) {
  63. _timeOutLabel = [UILabel new];
  64. _timeOutLabel.font = [UIFont systemFontOfSize:14];
  65. _timeOutLabel.textColor = UIColorFromRGB(0x666666);
  66. _timeOutLabel.textAlignment = NSTextAlignmentCenter;
  67. _timeOutLabel.text = @"了解超时赔付";
  68. }
  69. return _timeOutLabel;
  70. }
  71. @end