| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- //
- // JOSWXXCell.m
- // shiku_im
- //
- // Created by 周兵 on 16/6/29.
- // Copyright © 2016年 Reese. All rights reserved.
- //
- #import "JOSWXXCell.h"
- #import "JOSWXXModel.h"
- @interface JOSWXXCell()
- @property (nonatomic,strong) UILabel * contentLabel;
- @property (nonatomic,strong) UILabel * dateTimeLabel;
- @end
- @implementation JOSWXXCell
- + (instancetype)cellWithTableView:(UITableView *)tableView
- {
- static NSString *ID = @"status";
- JOSWXXCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
- if (!cell) {
- cell = [[JOSWXXCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
-
- }
- return cell;
- }
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if(self)
- {
- //cell点击美效果
- self.selectionStyle=UITableViewCellSelectionStyleNone;
- self.contentView.backgroundColor=JOColor(160,160,160,0.1);
- //初始化控件内容
- [self setDYModel];
-
- }
-
- return self;
- }
- /**
- * 我的商务消息,初始化
- */
- - (void)setDYModel
- {
-
- UIView * bottomView=[[UIView alloc]init];
- bottomView.backgroundColor=[UIColor whiteColor];
- bottomView.frame=CGRectMake(20,10,self.frame.size.width-40,80);
- [self.contentView addSubview:bottomView];
-
-
-
-
- /**1,图片*/
- UIImageView * imageV=[[UIImageView alloc]init];
- imageV.frame=CGRectMake(10,10,16,16);
- imageV.image=[UIImage imageNamed:@"uu_swxx_02"];
- [bottomView addSubview:imageV];
-
- /**2,标题*/
- UILabel * title=[[UILabel alloc]init];
- title.frame=CGRectMake(25,0,80,30);
- title.text=@"商务消息";
- title.font=[UIFont systemFontOfSize:14];
- title.backgroundColor=[UIColor clearColor];
- title.textColor=[UIColor orangeColor];
- title.textAlignment=1;
- [bottomView addSubview:title];
-
- /**3,内容*/
- UILabel * content=[[UILabel alloc]init];
- content.frame=CGRectMake(10,35,30,25);
- content.text=@"内容:";
- content.textAlignment=0;
- content.textColor=JOColor(160,160,160,0.5);
- content.backgroundColor=[UIColor clearColor];
- content.font=[UIFont systemFontOfSize:12];
- [bottomView addSubview:content];
-
- /**4,日期时间*/
- UILabel * dateTime=[[UILabel alloc]init];
- dateTime.frame=CGRectMake(10,55,30,25);
- dateTime.text=@"时间:";
- dateTime.textAlignment=0;
- dateTime.textColor=JOColor(160,160,160,0.5);
- dateTime.backgroundColor=[UIColor clearColor];
- dateTime.font=[UIFont systemFontOfSize:12];
- [bottomView addSubview:dateTime];
-
- /**5,内容描述*/
- UILabel * contentStr=[[UILabel alloc]init];
- contentStr.frame=CGRectMake(45,35,self.frame.size.width-90,25);
- contentStr.text=@"这个是商务消息,消息很长需要换行怎么办呢啦啦啦啦啦啦啦啦lalalalalalla";
- contentStr.textAlignment=0;
- contentStr.numberOfLines=0;
- contentStr.textColor=[UIColor blackColor];
- contentStr.backgroundColor=[UIColor clearColor];
- contentStr.font=[UIFont systemFontOfSize:13];
- [bottomView addSubview:contentStr];
- self.contentLabel=contentStr;
-
- /**6,内容描述*/
- UILabel * dateStr=[[UILabel alloc]init];
- dateStr.frame=CGRectMake(45,55,self.frame.size.width-90,25);
- dateStr.text=@"2016-06-27 17:56:45";
- dateStr.textAlignment=0;
- dateStr.numberOfLines=0;
- dateStr.textColor=[UIColor blackColor];
- dateStr.backgroundColor=[UIColor clearColor];
- dateStr.font=[UIFont systemFontOfSize:13];
- [bottomView addSubview:dateStr];
- self.dateTimeLabel=dateStr;
-
-
- }
- - (void)setSWXXModel:(JOSWXXModel *)SWXXModel
- {
- _SWXXModel=SWXXModel;
-
- self.dateTimeLabel.text=_SWXXModel.time;
- self.contentLabel.text=_SWXXModel.content;
-
- }
- - (void)awakeFromNib {
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|