JXApplyTableViewCell.m 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // JXApplyTableViewCell.m
  3. // shiku_im
  4. //
  5. // Created by qiudezheng on 2020/4/29.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXApplyTableViewCell.h"
  9. @implementation JXApplyTableViewCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  15. [super setSelected:selected animated:animated];
  16. // Configure the view for the selected state
  17. }
  18. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  19. {
  20. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  21. if(self)
  22. {
  23. self.buttonLabel = [[UIButton alloc]init];
  24. self.buttonLabel.frame = CGRectMake(15, 20, 50, 50);
  25. [self.buttonLabel setTitle:@"" forState:UIControlStateNormal];
  26. //self.buttonLabel.textColor = [UIColor whiteColor];
  27. //self.buttonLabel.backgroundColor = [UIColor colorWithRed:239/255.0f green:185/255.0f blue:132/255.0f alpha:1.0f];
  28. self.buttonLabel.titleLabel.font = [UIFont systemFontOfSize:17.0f];
  29. //self.buttonLabel.titleLabel.textAlignment = NSTextAlignmentCenter;
  30. [self.buttonLabel.layer setCornerRadius:25.0f];
  31. [self.buttonLabel.layer setMasksToBounds:YES];
  32. [self addSubview:self.buttonLabel];
  33. UIView * progress = [[UIView alloc]initWithFrame:CGRectMake(self.buttonLabel.frame.origin.x + self.buttonLabel.frame.size.width + 5, (self.buttonLabel.frame.size.height + 40) / 2 - 2.5, JX_SCREEN_WIDTH - (self.buttonLabel.frame.origin.x + self.buttonLabel.frame.size.width + 5) - 10, 15)];
  34. progress.backgroundColor = [UIColor colorWithRed:126/255.0f green:23/255.0f blue:21/255.0f alpha:1.0f];
  35. [progress.layer setCornerRadius:5.0f];
  36. [progress.layer setMasksToBounds:YES];
  37. [progress.layer setBorderWidth:1.0f];
  38. [progress.layer setBorderColor:[[UIColor colorWithRed:253/255.0f green:219/255.0f blue:173/255.0f alpha:1.0f]CGColor]];
  39. self.widths = progress.frame.size.width;
  40. [self addSubview:progress];
  41. self.progressView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, progress.frame.size.height)];
  42. self.progressView.backgroundColor = self.buttonLabel.backgroundColor;
  43. [self.progressView.layer setCornerRadius:5.0f];
  44. [self.progressView.layer setMasksToBounds:YES];
  45. [progress addSubview:self.progressView];
  46. self.projectLabel = [[UILabel alloc]initWithFrame:CGRectMake(progress.frame.origin.x, progress.frame.origin.y - 15, 100, 15)];
  47. self.projectLabel.text = @"签到";
  48. self.projectLabel.textColor = [UIColor colorWithRed:240/255.0 green:225/255.0 blue:155/255.0 alpha:1.0];
  49. self.projectLabel.font = [UIFont systemFontOfSize:12.0f];
  50. [self addSubview:self.projectLabel];
  51. //self.coinLabel = [[UILabel alloc]initWithFrame:CGRectMake(JX_SCREEN_WIDTH - 21, progress.frame.origin.y - 15, 100, 15)];
  52. self.coinLabel = [[UILabel alloc]init];
  53. //self.coinLabel.text = @"?即信币";
  54. self.coinLabel.textColor = [UIColor colorWithRed:240/255.0 green:225/255.0 blue:155/255.0 alpha:1.0];
  55. self.coinLabel.font = [UIFont systemFontOfSize:12.0f];
  56. self.coinLabel.textAlignment = NSTextAlignmentRight;
  57. [self addSubview:self.coinLabel];
  58. [self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  59. make.top.mas_equalTo(progress.frame.origin.y-15);
  60. make.right.mas_equalTo(-15);
  61. }];
  62. self.detail = [[UILabel alloc]initWithFrame:CGRectMake(self.projectLabel.frame.origin.x, progress.frame.origin.y + progress.frame.size.height, JX_SCREEN_WIDTH/2, 15)];
  63. self.detail.text = @"已连续签到10天";
  64. self.detail.textColor = [UIColor colorWithRed:240/255.0 green:225/255.0 blue:155/255.0 alpha:1.0];
  65. self.detail.font = [UIFont systemFontOfSize:12.0f];
  66. [self addSubview:self.detail];
  67. self.descriptionLabel = [[UILabel alloc]initWithFrame:CGRectMake(JX_SCREEN_WIDTH - 210, progress.frame.origin.y + progress.frame.size.height, 200, 15)];
  68. self.descriptionLabel.text = @"距离领取奖励还差10条";
  69. self.descriptionLabel.textColor = [UIColor colorWithRed:240/255.0 green:225/255.0 blue:155/255.0 alpha:1.0];
  70. self.descriptionLabel.font = [UIFont systemFontOfSize:12.0f];
  71. self.descriptionLabel.textAlignment = NSTextAlignmentRight;
  72. [self addSubview:self.descriptionLabel];
  73. }
  74. return self;
  75. }
  76. @end