Ei kuvausta

SubmitCarriageMoneyCell.m 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // PdRightArrowTableViewCell.m
  3. // FirstLink
  4. //
  5. // Created by 王孝道 on 15/6/2.
  6. // Copyright (c) 2015年 FirstLink. All rights reserved.
  7. //
  8. #import "SubmitCarriageMoneyCell.h"
  9. @interface SubmitCarriageMoneyCell ()
  10. @property (nonatomic, strong) UIImageView *rightArrowImgView;
  11. @end
  12. @implementation SubmitCarriageMoneyCell
  13. @synthesize rightLabel = _rightLabel;
  14. @synthesize rightArrowImgView = _rightArrowImgView;
  15. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  16. {
  17. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  18. if (self) {
  19. [self initialize];
  20. self.selectionStyle = UITableViewCellSelectionStyleNone;
  21. }
  22. return self;
  23. }
  24. - (void)initialize
  25. {
  26. [self.contentView addSubview:self.rightArrowImgView];
  27. [self.contentView addSubview:self.rightLabel];
  28. [self.rightArrowImgView mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.right.equalTo(self.contentView).offset(- 10);
  30. make.centerY.equalTo(self.contentView);
  31. }];
  32. [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.centerY.equalTo(self.contentView);
  34. make.right.equalTo(self.rightArrowImgView.mas_left);
  35. }];
  36. }
  37. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  38. [super setSelected:selected animated:animated];
  39. // Configure the view for the selected state
  40. }
  41. #pragma mark - getter && setter
  42. - (UILabel *)rightLabel
  43. {
  44. if (_rightLabel == nil) {
  45. _rightLabel = [[UILabel alloc]init];
  46. _rightLabel.backgroundColor = [UIColor clearColor];
  47. _rightLabel.font = [UIFont systemFontOfSize:13];
  48. _rightLabel.textColor = UIColorFromRGB(0x333333);
  49. _rightLabel.textAlignment = NSTextAlignmentRight;
  50. }
  51. return _rightLabel;
  52. }
  53. - (UIImageView *)rightArrowImgView
  54. {
  55. if (_rightArrowImgView == nil) {
  56. _rightArrowImgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Alpha3_more_icon"]];
  57. }
  58. return _rightArrowImgView;
  59. }
  60. @end