123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- //
- // ChatMsgDetailChatCell.m
- // smartRhino
- //
- // Created by armin on 2019/11/7.
- // Copyright © 2019 tederen. All rights reserved.
- //
- #import "ChatMsgDetailChatCell.h"
- @implementation ChatMsgDetailChatCell
- - (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
- }
- + (CGFloat)configCell0Height{
- return 50;
- }
- + (CGFloat)configCell1Height{
- return 47 + 15;
- }
- + (CGFloat)configCell2HeightWithContent:(NSString *)content{
- CGFloat oneLineMaxW = SCREEN_WIDTH - (81+87);
-
- CGSize size = [content sizeWithFont:[UIFont systemFontOfSize:16] byWidth:oneLineMaxW textLineSpacing:5];
-
- if(size.height <= 40){
- return 40 + 15;
- }else{
- return size.height + 15 + 14*2;
- }
- }
- + (CGFloat)configCell3HeightWithContent:(NSString *)content{
- CGFloat oneLineMaxW = SCREEN_WIDTH - (81+87);
-
- CGSize size = [content sizeWithFont:[UIFont systemFontOfSize:16] byWidth:oneLineMaxW textLineSpacing:5];
-
- if(size.height <= 40){
- return 40 + 15;
- }else{
- return size.height + 15 + 14*2;
- }
- }
- + (ChatMsgDetailChatCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"ChatMsgDetailChatCell0";
- ChatMsgDetailChatCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"ChatMsgDetailChatCell" owner:nil options:nil] objectAtIndex:0];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- cell.backgroundColor = [UIColor clearColor];
- cell.contentView.backgroundColor = [UIColor clearColor];
- return cell;
- }
- + (ChatMsgDetailChatCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"ChatMsgDetailChatCell1";
- ChatMsgDetailChatCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"ChatMsgDetailChatCell" owner:nil options:nil] objectAtIndex:1];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- cell.backgroundColor = [UIColor clearColor];
- cell.contentView.backgroundColor = [UIColor clearColor];
- cell.cell1ContentBgView.width = SCREEN_WIDTH - 66*2;
- [cell.cell1ContentBgView setRadius:5 corners:UIRectCornerAllCorners];
- return cell;
- }
- + (ChatMsgDetailChatCell *)configCell2:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"ChatMsgDetailChatCell2";
- ChatMsgDetailChatCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"ChatMsgDetailChatCell" owner:nil options:nil] objectAtIndex:2];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- cell.backgroundColor = [UIColor clearColor];
- cell.contentView.backgroundColor = [UIColor clearColor];
- [cell.cell2LeftUserImg setRadius:2 corners:UIRectCornerAllCorners];
- // [cell.cell2LeftContentBgView setRadius:5 corners:UIRectCornerAllCorners];
- cell.cell2LeftContentBgView.layer.masksToBounds = YES;
- cell.cell2LeftContentBgView.layer.cornerRadius = 5;
-
- return cell;
- }
- + (ChatMsgDetailChatCell *)configCell3:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"ChatMsgDetailChatCell3";
- ChatMsgDetailChatCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"ChatMsgDetailChatCell" owner:nil options:nil] objectAtIndex:3];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- cell.backgroundColor = [UIColor clearColor];
- cell.contentView.backgroundColor = [UIColor clearColor];
- [cell.cell3RightUserImg setRadius:2 corners:UIRectCornerAllCorners];
- // [cell.cell3RightContentBgView setRadius:5 corners:UIRectCornerAllCorners];
- cell.cell3RightContentBgView.layer.masksToBounds = YES;
- cell.cell3RightContentBgView.layer.cornerRadius = 5;
-
- return cell;
- }
- @end
|