EMMessageTimeCell.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // EMMessageTimeCell.m
  3. // ChatDemo-UI3.0
  4. //
  5. // Created by XieYajie on 2019/2/20.
  6. // Copyright © 2019 XieYajie. All rights reserved.
  7. //
  8. #import "EMMessageTimeCell.h"
  9. @implementation EMMessageTimeCell
  10. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  11. {
  12. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  13. if (self) {
  14. self.selectionStyle = UITableViewCellSelectionStyleNone;
  15. self.backgroundColor = kColor_LightGray;
  16. self.contentView.backgroundColor = kColor_LightGray;
  17. _timeLabel = [[UILabel alloc] init];
  18. _timeLabel.font = [UIFont systemFontOfSize:14];
  19. _timeLabel.textColor = [UIColor grayColor];
  20. _timeLabel.backgroundColor = [UIColor clearColor];
  21. _timeLabel.textAlignment = NSTextAlignmentCenter;
  22. [self.contentView addSubview:_timeLabel];
  23. [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  24. make.edges.equalTo(self.contentView);
  25. make.height.equalTo(@30);
  26. }];
  27. }
  28. return self;
  29. }
  30. - (void)awakeFromNib {
  31. [super awakeFromNib];
  32. // Initialization code
  33. }
  34. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  35. [super setSelected:selected animated:animated];
  36. // Configure the view for the selected state
  37. }
  38. @end