暂无描述

FKInviteTableCell.m 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // FKInviteTableCell.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/5/28.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKInviteTableCell.h"
  9. @implementation FKInviteTableCell
  10. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
  12. [self addAllSubviews];
  13. self.selectionStyle = UITableViewCellSelectionStyleNone;
  14. self.backgroundColor = [UIColor clearColor];
  15. self.backgroundView = nil;
  16. }
  17. return self;
  18. }
  19. - (void)addAllSubviews{
  20. [self.contentView addSubview:self.imgView];
  21. [self.contentView addSubview:self.nameLabel];
  22. [self.contentView addSubview:self.titleLabel];
  23. [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
  24. make.left.equalTo(self.contentView).offset(10);
  25. make.centerY.equalTo(self.contentView);
  26. make.width.height.mas_equalTo(33);
  27. }];
  28. [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.left.equalTo(self.imgView.mas_right).offset(10);
  30. make.centerY.equalTo(self.imgView);
  31. }];
  32. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.right.equalTo(self.contentView).offset(- 15);
  34. make.centerY.equalTo(self.imgView);
  35. }];
  36. }
  37. #pragma mark - property
  38. - (AvatarImageView *)imgView{
  39. if (_imgView == nil) {
  40. _imgView = [[AvatarImageView alloc]initWithFrame:CGRectMake(0, 0, 33, 33) boardWidth:0 boardColor:nil];
  41. }
  42. return _imgView;
  43. }
  44. - (UILabel *)nameLabel{
  45. if (_nameLabel == nil) {
  46. _nameLabel = [[UILabel alloc]init];
  47. _nameLabel.font = [UIFont systemFontOfSize:13];
  48. _nameLabel.textColor = UIColorFromRGB(0x333333);
  49. }
  50. return _nameLabel;
  51. }
  52. - (UILabel *)titleLabel{
  53. if (_titleLabel == nil) {
  54. _titleLabel = [[UILabel alloc]init];
  55. _titleLabel.font = [UIFont systemFontOfSize:13];
  56. _titleLabel.textColor = UIColorFromRGB(0x333333);
  57. }
  58. return _titleLabel;
  59. }
  60. @end