Aucune description

FKCirDetailCommentHeadView.m 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // FKCirDetailCommentHeadView.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/6/15.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKCirDetailCommentHeadView.h"
  9. @interface FKCirDetailCommentHeadView ()
  10. @property (nonatomic, strong) UILabel *leftLabel;
  11. @property (nonatomic, strong) UIView *bottomLine;
  12. @end
  13. @implementation FKCirDetailCommentHeadView
  14. - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
  15. if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
  16. [self addAllSubviews];
  17. self.contentView.backgroundColor = [UIColor whiteColor];
  18. }
  19. return self;
  20. }
  21. - (void)addAllSubviews{
  22. [self.contentView addSubview:self.leftLabel];
  23. [self.contentView addSubview:self.rightBtn];
  24. [self.contentView addSubview:self.bottomLine];
  25. [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.left.equalTo(self.contentView).offset(15);
  27. make.centerY.equalTo(self.contentView);
  28. }];
  29. [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.right.equalTo(self.contentView).offset(- 15);
  31. make.centerY.equalTo(self.contentView);
  32. make.height.equalTo(self.contentView);
  33. }];
  34. [self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
  35. make.left.equalTo(self.contentView).offset(15);
  36. make.width.mas_equalTo(UISCREENWIDTH - 15);
  37. make.bottom.equalTo(self.contentView);
  38. make.height.mas_equalTo(0.5);
  39. }];
  40. }
  41. - (UILabel *)leftLabel{
  42. if (_leftLabel == nil) {
  43. _leftLabel = [[UILabel alloc]init];
  44. _leftLabel.font = [UIFont systemFontOfSize:14];
  45. _leftLabel.textColor = UIColorFromRGB(0x333333);
  46. _leftLabel.text = @"评论";
  47. }
  48. return _leftLabel;
  49. }
  50. - (UIButton *)rightBtn{
  51. if (_rightBtn == nil) {
  52. _rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  53. [_rightBtn setTitle:@"查看所有评论" forState:UIControlStateNormal];
  54. [_rightBtn setTitleColor:UIColorFromRGB(0x9b9b9b) forState:UIControlStateNormal];
  55. _rightBtn.titleLabel.font = [UIFont systemFontOfSize:13];
  56. _rightBtn.hidden = YES;
  57. }
  58. return _rightBtn;
  59. }
  60. - (UIView *)bottomLine{
  61. if (_bottomLine == nil) {
  62. _bottomLine = [[UIView alloc]init];
  63. _bottomLine.backgroundColor = UIColorFromRGB(0xf4f4f4);
  64. }
  65. return _bottomLine;
  66. }
  67. @end