123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- //
- // JXApplyTableViewCell.m
- // shiku_im
- //
- // Created by qiudezheng on 2020/4/29.
- // Copyright © 2020 Reese. All rights reserved.
- //
- #import "JXApplyTableViewCell.h"
- @implementation JXApplyTableViewCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if(self)
- {
- self.buttonLabel = [[UIButton alloc]init];
- self.buttonLabel.frame = CGRectMake(15, 20, 50, 50);
- [self.buttonLabel setTitle:@"" forState:UIControlStateNormal];
- //self.buttonLabel.textColor = [UIColor whiteColor];
- //self.buttonLabel.backgroundColor = [UIColor colorWithRed:239/255.0f green:185/255.0f blue:132/255.0f alpha:1.0f];
- self.buttonLabel.titleLabel.font = [UIFont systemFontOfSize:17.0f];
- //self.buttonLabel.titleLabel.textAlignment = NSTextAlignmentCenter;
- [self.buttonLabel.layer setCornerRadius:25.0f];
- [self.buttonLabel.layer setMasksToBounds:YES];
- [self addSubview:self.buttonLabel];
-
- 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)];
- progress.backgroundColor = [UIColor colorWithRed:126/255.0f green:23/255.0f blue:21/255.0f alpha:1.0f];
- [progress.layer setCornerRadius:5.0f];
- [progress.layer setMasksToBounds:YES];
- [progress.layer setBorderWidth:1.0f];
- [progress.layer setBorderColor:[[UIColor colorWithRed:253/255.0f green:219/255.0f blue:173/255.0f alpha:1.0f]CGColor]];
- self.widths = progress.frame.size.width;
- [self addSubview:progress];
-
- self.progressView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, progress.frame.size.height)];
- self.progressView.backgroundColor = self.buttonLabel.backgroundColor;
- [self.progressView.layer setCornerRadius:5.0f];
- [self.progressView.layer setMasksToBounds:YES];
- [progress addSubview:self.progressView];
-
- self.projectLabel = [[UILabel alloc]initWithFrame:CGRectMake(progress.frame.origin.x, progress.frame.origin.y - 15, 100, 15)];
- self.projectLabel.text = @"签到";
- self.projectLabel.textColor = [UIColor colorWithRed:240/255.0 green:225/255.0 blue:155/255.0 alpha:1.0];
- self.projectLabel.font = [UIFont systemFontOfSize:12.0f];
- [self addSubview:self.projectLabel];
-
- //self.coinLabel = [[UILabel alloc]initWithFrame:CGRectMake(JX_SCREEN_WIDTH - 21, progress.frame.origin.y - 15, 100, 15)];
- self.coinLabel = [[UILabel alloc]init];
- //self.coinLabel.text = @"?即信币";
- self.coinLabel.textColor = [UIColor colorWithRed:240/255.0 green:225/255.0 blue:155/255.0 alpha:1.0];
- self.coinLabel.font = [UIFont systemFontOfSize:12.0f];
- self.coinLabel.textAlignment = NSTextAlignmentRight;
- [self addSubview:self.coinLabel];
- [self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(progress.frame.origin.y-15);
- make.right.mas_equalTo(-15);
- }];
-
- self.detail = [[UILabel alloc]initWithFrame:CGRectMake(self.projectLabel.frame.origin.x, progress.frame.origin.y + progress.frame.size.height, JX_SCREEN_WIDTH/2, 15)];
- self.detail.text = @"已连续签到10天";
- self.detail.textColor = [UIColor colorWithRed:240/255.0 green:225/255.0 blue:155/255.0 alpha:1.0];
- self.detail.font = [UIFont systemFontOfSize:12.0f];
- [self addSubview:self.detail];
-
- self.descriptionLabel = [[UILabel alloc]initWithFrame:CGRectMake(JX_SCREEN_WIDTH - 210, progress.frame.origin.y + progress.frame.size.height, 200, 15)];
- self.descriptionLabel.text = @"距离领取奖励还差10条";
- self.descriptionLabel.textColor = [UIColor colorWithRed:240/255.0 green:225/255.0 blue:155/255.0 alpha:1.0];
- self.descriptionLabel.font = [UIFont systemFontOfSize:12.0f];
- self.descriptionLabel.textAlignment = NSTextAlignmentRight;
- [self addSubview:self.descriptionLabel];
-
- }
- return self;
- }
- @end
|