RecordCell.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // RecordCell.m
  3. // jiaPeiC
  4. //
  5. // Created by apple on 16/3/21.
  6. // Copyright © 2016年 JCZ. All rights reserved.
  7. //
  8. #import "RecordCell.h"
  9. @implementation RecordCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  15. {
  16. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  17. if (self)
  18. {
  19. _dateLabel = [UILabel new];
  20. _dateLabel.textAlignment = NSTextAlignmentRight;
  21. [self addSubview:_dateLabel];
  22. //[self.textLabel boardWid:1 Color:defGreen];
  23. }
  24. return self;
  25. }
  26. -(void)layoutSubviews
  27. {
  28. [super layoutSubviews];
  29. CGFloat x,y,w,h;
  30. w = 130;
  31. x = kSize.width - w - 40;
  32. if (kSize.width < 350) {
  33. x = kSize.width - w - 10;
  34. }
  35. y = self.textLabel.y;
  36. h = self.textLabel.height;
  37. _dateLabel.frame = CGRectMake(x, y, w, h);
  38. CGRect size = self.detailTextLabel.frame;
  39. size.origin.x = 40;
  40. size.origin.y = 50;
  41. size.size.width = kSize.width - 70;
  42. self.detailTextLabel.frame = size;
  43. }
  44. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  45. [super setSelected:selected animated:animated];
  46. // Configure the view for the selected state
  47. }
  48. @end