1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- //
- // JXXinRenLookCell.m
- // shiku_im
- //
- // Created by 123 on 2020/5/25.
- // Copyright © 2020 Reese. All rights reserved.
- //
- #import "JXXinRenLookCell.h"
- @interface JXXinRenLookCell()
- @property (nonatomic,weak) UIImageView *iconIMG;
- @property (nonatomic,weak) UILabel *titleL;
- @property (nonatomic,weak) UILabel *subtitleL;
- @end
- @implementation JXXinRenLookCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- }
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
-
- if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
-
- UIImageView *iconIMG=[[UIImageView alloc]init];
- iconIMG.image=[UIImage imageNamed:@"xinrenbikan"];
- [self.contentView addSubview:iconIMG];
- self.iconIMG=iconIMG;
- [iconIMG mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(1);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(96);
- }];
-
- UILabel *titleL=[[UILabel alloc]init];
- titleL.text=@"玩转即信";
- titleL.textColor=kRGBColor151;
- titleL.font=[UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
- [self.contentView addSubview:titleL];
- self.titleL=titleL;
- [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(iconIMG.mas_bottom).mas_offset(10);
- make.left.mas_equalTo(10);
- }];
-
- UILabel *subtitleL=[[UILabel alloc]init];
- subtitleL.text=@"教您如何快速玩转即信";
- subtitleL.textColor=kRGBColor151;
- subtitleL.font=[UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
- [self.contentView addSubview:subtitleL];
- self.subtitleL=subtitleL;
- [subtitleL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(titleL.mas_bottom).mas_offset(10);
- make.left.mas_equalTo(10);
- }];
- }
-
- return self;
- }
- + (instancetype)cellWithTableView:(UITableView *)tableView
- {
- static NSString *ID = @"JXXinRenLookCell";
- JXXinRenLookCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
-
- if (!cell) {
- cell = [[JXXinRenLookCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
- cell.selectionStyle=UITableViewCellSelectionStyleNone;
- }
- return cell;
- }
- -(void)setDictData:(NSDictionary *)dictData{
-
- self.titleL.text=dictData[@"title"];
- self.subtitleL.text=dictData[@"subtitle"];
- self.iconIMG.image=[UIImage imageNamed:dictData[@"icon"]];
- }
- -(void)setFrame:(CGRect)frame{
- frame.origin.y+=30;
- frame.size.height-=30;
- frame.size.width=JX_SCREEN_WIDTH-44;
- frame.origin.x=22;
- [super setFrame:frame];
- }
- @end
|