Açıklama Yok

FKBindTipCell.m 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // FKBindTipView.m
  3. // FirstLink
  4. //
  5. // Created by jack on 15/11/3.
  6. // Copyright © 2015年 FirstLink. All rights reserved.
  7. //
  8. #import "FKBindTipCell.h"
  9. @interface FKBindTipCell ()
  10. @property (nonatomic, strong) UILabel *subLabel;
  11. @end
  12. @implementation FKBindTipCell
  13. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  14. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  15. self.contentView.backgroundColor = UIColorFromRGB(0xeeeeee);
  16. self.selectionStyle = UITableViewCellSelectionStyleNone;
  17. [self addAllSubviews];
  18. }
  19. return self;
  20. }
  21. - (void)addAllSubviews{
  22. UIView *realContentView = ({
  23. UIView *view = [[UIView alloc]init];
  24. view.backgroundColor = UIColorFromRGB(0xffffff);
  25. view;
  26. });
  27. [self.contentView addSubview:realContentView];
  28. [realContentView addSubview:self.iconImgView];
  29. [realContentView addSubview:self.titleLabel];
  30. [realContentView addSubview:self.subLabel];
  31. [realContentView mas_makeConstraints:^(MASConstraintMaker *make) {
  32. make.edges.insets(UIEdgeInsetsMake(0, 0, 10, 0));
  33. }];
  34. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  35. make.bottom.equalTo(realContentView.mas_centerY).offset(- 5);
  36. make.centerX.equalTo(realContentView).offset(10);
  37. }];
  38. [self.iconImgView mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.right.equalTo(self.titleLabel.mas_left).offset(- 5);
  40. make.centerY.equalTo(self.titleLabel);
  41. }];
  42. [self.subLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  43. make.top.equalTo(realContentView.mas_centerY).offset(5);
  44. make.centerX.equalTo(realContentView);
  45. }];
  46. }
  47. #pragma mark - property
  48. - (UILabel *)titleLabel{
  49. if (_titleLabel == nil) {
  50. _titleLabel = [[UILabel alloc]init];
  51. _titleLabel.font = [UIFont systemFontOfSize:16];
  52. _titleLabel.textColor = UIColorFromRGB(0x333333);
  53. }
  54. return _titleLabel;
  55. }
  56. - (UILabel *)subLabel{
  57. if (_subLabel == nil) {
  58. _subLabel = [[UILabel alloc]init];
  59. _subLabel.font = [UIFont systemFontOfSize:14];
  60. _subLabel.textColor = UIColorFromRGB(0x999999);
  61. _subLabel.text = @"(身份证信息务必与收货人信息一致哦)";
  62. }
  63. return _subLabel;
  64. }
  65. - (UIImageView *)iconImgView{
  66. if (_iconImgView == nil) {
  67. _iconImgView = [[UIImageView alloc]init];
  68. }
  69. return _iconImgView;
  70. }
  71. @end