- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *ID = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
}
NSDictionary *topic = self.topics[indexPath.row];
cell.textLabel.text = topic[@"name"];
cell.detailTextLabel.text = topic[@"text"];
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:topic[@"profile_image"]] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
return cell;
}
不自定义cell,最原始的创建UITableViewCell
最新推荐文章于 2025-08-16 09:06:53 发布