Nav apraksta

FKExploreMoreCell.m 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // FKExploreModeCell.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 16/2/18.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKExploreMoreCell.h"
  9. @interface FKExploreMoreCell ()
  10. @end
  11. @implementation FKExploreMoreCell
  12. - (instancetype)initWithFrame:(CGRect)frame {
  13. if (self = [super initWithFrame:frame]) {
  14. [self addAllSubviews];
  15. }
  16. return self;
  17. }
  18. - (void)addAllSubviews {
  19. self.bgView = [self makeBoxView];
  20. [self.contentView addSubview:self.bgView];
  21. [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
  22. make.left.right.equalTo(self.contentView);
  23. make.top.equalTo(self.contentView).offset(10);
  24. make.height.equalTo(self.contentView.mas_width);
  25. }];
  26. UIView *line = [UIView new];
  27. line.backgroundColor = UIColorFromRGB(0x999999);
  28. [self.bgView addSubview:line];
  29. [line mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.center.equalTo(self.bgView);
  31. make.width.mas_equalTo(60);
  32. make.height.mas_equalTo(1);
  33. }];
  34. UILabel *upLabel = [self makeTitleLabel];
  35. upLabel.font = [UIFont systemFontOfSize:15];
  36. upLabel.textColor = UIColorFromRGB(0xFF624A);
  37. upLabel.text = @"查看更多";
  38. [self.bgView addSubview:upLabel];
  39. [upLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  40. make.centerX.equalTo(self.bgView);
  41. make.bottom.equalTo(line.mas_top).offset(-4);
  42. }];
  43. UILabel *bollowLabel = [self makeTitleLabel];
  44. bollowLabel.font = [UIFont systemFontOfSize:14];
  45. bollowLabel.textColor = UIColorFromRGB(0x999999);
  46. bollowLabel.text = @"See More";
  47. [self.bgView addSubview:bollowLabel];
  48. [bollowLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  49. make.centerX.equalTo(self.bgView);
  50. make.top.equalTo(line.mas_bottom).offset(4);
  51. }];
  52. }
  53. - (void)remakeEdgesZero {
  54. [self.bgView mas_remakeConstraints:^(MASConstraintMaker *make) {
  55. make.left.right.equalTo(self.contentView);
  56. make.top.equalTo(self.contentView).offset(0);
  57. make.height.equalTo(self.contentView.mas_width);
  58. }];
  59. }
  60. - (UIView *)makeBoxView {
  61. UIView *boxView = [UIView new];
  62. boxView.layer.borderWidth = 1.0/[UIScreen mainScreen].scale;
  63. boxView.layer.borderColor = UIColorFromRGB(0xe5e5e5).CGColor;
  64. return boxView;
  65. }
  66. - (UILabel *)makeTitleLabel {
  67. UILabel *label = [UILabel new];
  68. label.textAlignment = NSTextAlignmentCenter;
  69. return label;
  70. }
  71. @end