説明なし

FKPointDetailListCell.m 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. //
  2. // FKPointDetailListCell.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/3/12.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKPointDetailListCell.h"
  9. @interface FKPointDetailListCell ()
  10. @property (nonatomic, strong) UIView *smallCircleView;
  11. @property (nonatomic, strong) UIView *bigCircelView;
  12. @property (nonatomic, strong) UIView *vertLine;
  13. @end
  14. @implementation FKPointDetailListCell
  15. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  16. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
  17. [self addAllSubviews];
  18. self.selectionStyle = UITableViewCellSelectionStyleNone;
  19. self.contentView.backgroundColor = [UIColor clearColor];
  20. self.backgroundColor = [UIColor clearColor];
  21. self.backgroundView = nil;
  22. }
  23. return self;
  24. }
  25. - (void)addAllSubviews{
  26. [self.contentView addSubview:self.addPointLabel];
  27. [self.contentView addSubview:self.sourceLabel];
  28. [self.contentView addSubview:self.timeLabel];
  29. [self.contentView addSubview:self.vertLine];
  30. [self.contentView addSubview:self.smallCircleView];
  31. [self.contentView addSubview:self.bigCircelView];
  32. [self.smallCircleView mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.left.equalTo(self.contentView).offset(40);
  34. make.top.equalTo(self.contentView).offset(20);
  35. make.width.height.mas_equalTo(8);
  36. }];
  37. [self.bigCircelView mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.center.equalTo(self.smallCircleView);
  39. make.width.height.mas_equalTo(13);
  40. }];
  41. [self.vertLine mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.centerX.equalTo(self.smallCircleView);
  43. // make.top.equalTo(self.contentView);
  44. make.top.equalTo(self.smallCircleView.mas_bottom);
  45. make.bottom.equalTo(self.contentView).offset(30);
  46. make.width.mas_equalTo(0.5);
  47. }];
  48. [self.addPointLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  49. make.top.equalTo(self.contentView).offset(10);
  50. make.left.equalTo(self.bigCircelView.mas_right).offset(15);
  51. }];
  52. [self.sourceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  53. make.left.equalTo(self.addPointLabel);
  54. make.right.equalTo(self.contentView).offset(- 15);
  55. make.top.equalTo(self.addPointLabel.mas_bottom).offset(15);
  56. }];
  57. [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  58. make.left.equalTo(self.addPointLabel);
  59. make.top.equalTo(self.sourceLabel.mas_bottom).offset(7);
  60. }];
  61. }
  62. #pragma mark - property
  63. - (UILabel *)addPointLabel{
  64. if (_addPointLabel == nil) {
  65. _addPointLabel = [[UILabel alloc]init];
  66. _addPointLabel.font = [UIFont boldSystemFontOfSize:24];
  67. _addPointLabel.textColor = UIColorFromRGB(0x333333);
  68. }
  69. return _addPointLabel;
  70. }
  71. - (UILabel *)sourceLabel{
  72. if (_sourceLabel == nil) {
  73. _sourceLabel = [[UILabel alloc]init];
  74. _sourceLabel.font = [UIFont systemFontOfSize:14];
  75. _sourceLabel.textColor = UIColorFromRGB(0x333333);
  76. _sourceLabel.lineBreakMode = NSLineBreakByTruncatingTail;
  77. }
  78. return _sourceLabel;
  79. }
  80. - (UILabel *)timeLabel{
  81. if (_timeLabel == nil) {
  82. _timeLabel = [[UILabel alloc]init];
  83. _timeLabel.font = [UIFont systemFontOfSize:14];
  84. _timeLabel.textColor = UIColorFromRGB(0x999999);
  85. }
  86. return _timeLabel;
  87. }
  88. - (UIView *)smallCircleView{
  89. if (_smallCircleView == nil) {
  90. _smallCircleView = [[UIView alloc]init];
  91. _smallCircleView.backgroundColor = UIColorFromRGB(0xff6362);
  92. _smallCircleView.layer.cornerRadius = 4;
  93. }
  94. return _smallCircleView;
  95. }
  96. - (UIView *)bigCircelView{
  97. if (_bigCircelView == nil) {
  98. _bigCircelView = [[UIView alloc]init];
  99. _bigCircelView.backgroundColor = [UIColorFromRGB(0xff6362) colorWithAlphaComponent:0.2];
  100. _bigCircelView.layer.cornerRadius = 6.5;
  101. }
  102. return _bigCircelView;
  103. }
  104. - (UIView *)vertLine{
  105. if (_vertLine == nil) {
  106. _vertLine = [[UIView alloc]init];
  107. _vertLine.backgroundColor = UIColorFromRGB(0xff6362);
  108. }
  109. return _vertLine;
  110. }
  111. @end