ImmediatelyCollectionViewCell.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. //
  2. // ImmediatelyCollectionViewCell.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2018/2/6.
  6. // Copyright © 2018年 罗云飞. All rights reserved.
  7. //
  8. #import "ImmediatelyCollectionViewCell.h"
  9. @implementation ImmediatelyCollectionViewCell{
  10. UIImageView *image;
  11. UILabel *title;
  12. }
  13. - (id)initWithFrame:(CGRect)frame
  14. {
  15. self = [super initWithFrame:frame];
  16. if (self) {
  17. image = [UIImageView new];
  18. image.backgroundColor = NewRedColor;
  19. // [self addSubview:image];
  20. image.sd_layout
  21. .leftEqualToView(self)
  22. .rightEqualToView(self)
  23. .heightIs(30)
  24. .topEqualToView(self);
  25. _immediatelyrelease = [UILabel new];
  26. [_immediatelyrelease setText:@"立即发布"];
  27. _immediatelyrelease.font = NewFont(15);
  28. [_immediatelyrelease setSingleLineAutoResizeWithMaxWidth:0];
  29. [self addSubview:_immediatelyrelease];
  30. _immediatelyrelease.sd_layout
  31. .centerXEqualToView(self)
  32. .heightIs(15)
  33. .topSpaceToView(self, 10);
  34. UIImageView *line1 = [UIImageView new];
  35. [line1 setImage:NewImageNamed(@"fbbxz")];
  36. [self addSubview:line1];
  37. line1.sd_layout
  38. .rightSpaceToView(_immediatelyrelease, 10)
  39. .heightIs(1)
  40. .leftSpaceToView(self, fitScreenWidth(40))
  41. .centerYEqualToView(_immediatelyrelease);
  42. UIImageView *line2 = [UIImageView new];
  43. [line2 setImage:NewImageNamed(@"fbbxy")];
  44. [self addSubview:line2];
  45. line2.sd_layout
  46. .rightSpaceToView(self, fitScreenWidth(40))
  47. .heightIs(1)
  48. .leftSpaceToView(_immediatelyrelease, 10)
  49. .centerYEqualToView(_immediatelyrelease);
  50. title = [UILabel new];
  51. title.text = @"全领域的技术交易平台";
  52. title.font = NewFont(13);
  53. title.textColor = [UIColor colorWithString:@"#9A9A9A"];
  54. [title setSingleLineAutoResizeWithMaxWidth:0];
  55. [self addSubview:title];
  56. title.sd_layout
  57. .topSpaceToView(image, 5)
  58. .heightIs(15)
  59. .centerXEqualToView(self);
  60. _releaserequirementsBT = [UIButton new];
  61. [_releaserequirementsBT setTitle:@"发布需求" forState:0];
  62. [_releaserequirementsBT setTitleColor:NewButtonColor forState:0];
  63. _releaserequirementsBT.titleLabel.font = NewFont(13);
  64. ViewBorderRadius(_releaserequirementsBT, 5, 1, NewButtonColor);
  65. [self addSubview:_releaserequirementsBT];
  66. _releaserequirementsBT.sd_layout
  67. .rightSpaceToView(self, self.width/2+(54/2))
  68. .heightIs(27)
  69. .widthIs(70)
  70. .bottomSpaceToView(self, 25);
  71. _releaseresultsBT = [UIButton new];
  72. [_releaseresultsBT setTitle:@"发布知产" forState:0];
  73. [_releaseresultsBT setTitleColor:NewWhiteColor forState:0];
  74. _releaseresultsBT.backgroundColor = NewButtonColor;
  75. _releaseresultsBT.titleLabel.font = NewFont(13);
  76. ViewBorderRadius(_releaseresultsBT, 5, 1, NewClearColor);
  77. [self addSubview:_releaseresultsBT];
  78. _releaseresultsBT.sd_layout
  79. .leftSpaceToView(_releaserequirementsBT, 54)
  80. .heightIs(27)
  81. .widthIs(70)
  82. .bottomSpaceToView(self, 25);
  83. UILabel *line = [UILabel new];
  84. line.backgroundColor = NewLineGrayColor;
  85. [self addSubview:line];
  86. line.sd_layout
  87. .leftEqualToView(self)
  88. .rightEqualToView(self)
  89. .heightIs(10)
  90. .bottomEqualToView(self);
  91. }
  92. return self;
  93. }
  94. @end