暂无描述

DetailMoreCommentCell.m 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // DetailMoreCommentCell.m
  3. // FirstLink
  4. //
  5. // Created by jack on 15/9/9.
  6. // Copyright (c) 2015年 FirstLink. All rights reserved.
  7. //
  8. #import "DetailMoreCommentCell.h"
  9. @interface DetailMoreCommentCell ()
  10. @property (nonatomic, strong) UILabel *titleLabel;
  11. @end
  12. @implementation DetailMoreCommentCell
  13. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  14. {
  15. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  16. if (self) {
  17. [self addAllSubviews];
  18. self.selectionStyle = UITableViewCellSelectionStyleNone;
  19. }
  20. return self;
  21. }
  22. - (void)addAllSubviews{
  23. [self.contentView addSubview:self.titleLabel];
  24. [self.contentView addSubview:self.moreActionBtn];
  25. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.center.equalTo(self.contentView);
  27. make.size.mas_equalTo(CGSizeMake(105, 23));
  28. }];
  29. [self.moreActionBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.center.equalTo(self.contentView);
  31. make.width.mas_equalTo(150);
  32. make.height.equalTo(self.contentView);
  33. }];
  34. }
  35. - (UILabel *)titleLabel{
  36. if (_titleLabel == nil) {
  37. _titleLabel = [[UILabel alloc]init];
  38. _titleLabel.font = [UIFont systemFontOfSize:12];
  39. _titleLabel.textColor = UIColorFromRGB(0x999999);
  40. _titleLabel.backgroundColor = [UIColor colorWithRed:234 / 255.0 green:234 / 255.0 blue:234 / 255.0 alpha:1.0];
  41. _titleLabel.text = @"查看所有评论";
  42. _titleLabel.layer.cornerRadius = 10;
  43. _titleLabel.layer.masksToBounds = YES;
  44. _titleLabel.textAlignment = NSTextAlignmentCenter;
  45. }
  46. return _titleLabel;
  47. }
  48. - (UIButton *)moreActionBtn{
  49. if (_moreActionBtn == nil) {
  50. _moreActionBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  51. }
  52. return _moreActionBtn;
  53. }
  54. @end