- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (self.sessionArray.count == 0) {
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
static NSString *MY = @"my";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MY];
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MY];
UILabel *noMsgLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.view.bounds.size.height / 2, cell.frame.size.width, 59)];
noMsgLabel.text = @"暂无历史消息";
noMsgLabel.textColor = [UIColor darkGrayColor];
noMsgLabel.textAlignment = NSTextAlignmentCenter;
[cell.contentView addSubview:noMsgLabel];
cell.selectionStyle = UITableViewCellAccessoryNone;
}
return cell;
}
tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
static NSString *sessioncellid = @"sessionCellidentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:sessioncellid];
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:sessioncellid];
}
cell.textLabel.text = @"今天太热了";
return cell;
}
ios 暂无聊天消息设置
最新推荐文章于 2024-09-15 18:43:54 发布