Няма описание

FKAddressDetailCell.m 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // EditAddressCell.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 15/5/28.
  6. // Copyright (c) 2015年 FirstLink. All rights reserved.
  7. //
  8. #import "FKAddressDetailCell.h"
  9. @implementation FKAddressDetailCell
  10. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  11. [super setSelected:selected animated:animated];
  12. // Configure the view for the selected state
  13. }
  14. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  15. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  16. if (self) {
  17. [self addAllSubviews];
  18. }
  19. return self;
  20. }
  21. - (void)addAllSubviews {
  22. WeakSelf(weakSelf);
  23. [self.contentView addSubview:self.tipLabel];
  24. [self.tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  25. make.left.equalTo(weakSelf.contentView).offset(8);
  26. make.top.equalTo(weakSelf.contentView).offset(12);
  27. make.width.mas_equalTo(82);
  28. make.height.mas_equalTo(20);
  29. }];
  30. [self.contentView addSubview:self.textView];
  31. [self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
  32. make.left.equalTo(weakSelf.tipLabel.mas_right).offset(8);
  33. make.top.equalTo(weakSelf.contentView).offset(4);
  34. make.right.equalTo(weakSelf.contentView).offset(-8);
  35. make.bottom.equalTo(weakSelf.contentView).offset(-4);
  36. make.width.mas_greaterThanOrEqualTo(40);
  37. }];
  38. [self.contentView addSubview:self.arrowIcon];
  39. [self.arrowIcon mas_makeConstraints:^(MASConstraintMaker *make) {
  40. make.top.equalTo(weakSelf.contentView).with.offset(12);
  41. make.right.equalTo(weakSelf.contentView).with.offset(-8);
  42. make.width.mas_equalTo(20);
  43. make.height.mas_equalTo(20);
  44. }];
  45. UIView *line = [self makeNewLine];
  46. [self.contentView addSubview:line];
  47. [line mas_makeConstraints:^(MASConstraintMaker *make) {
  48. make.left.equalTo(weakSelf.contentView);
  49. make.right.equalTo(weakSelf.contentView);
  50. make.bottom.equalTo(weakSelf.contentView);
  51. make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale);
  52. }];
  53. }
  54. #pragma mark - Property
  55. - (UILabel *)tipLabel {
  56. if (!_tipLabel) {
  57. _tipLabel = [[UILabel alloc] init];
  58. _tipLabel.textColor = UIColorFromRGB(0x7a7a7a);
  59. _tipLabel.font = [UIFont systemFontOfSize:16.0];
  60. }
  61. return _tipLabel;
  62. }
  63. - (UIPlaceHolderTextView *)textView {
  64. if (!_textView) {
  65. _textView = [[UIPlaceHolderTextView alloc] init];
  66. _textView.font = [UIFont systemFontOfSize:16.0];
  67. _textView.placeholderColor = UIColorFromRGB(0x999999);
  68. _textView.scrollEnabled = NO;
  69. }
  70. return _textView;
  71. }
  72. - (UIImageView*)arrowIcon {
  73. if (!_arrowIcon) {
  74. _arrowIcon = [[UIImageView alloc] init];
  75. _arrowIcon.image = [UIImage imageNamed:@"Alpha3_more_icon"];
  76. }
  77. return _arrowIcon;
  78. }
  79. - (UIView*)makeNewLine {
  80. UIView *line = [[UIView alloc] init];
  81. line.backgroundColor = UIColorFromRGB(0xcccccc);
  82. return line;
  83. }
  84. @end