gpt4 book ai didi

ios - 向 UITableView 添加字幕数组

转载 作者:行者123 更新时间:2023-11-29 01:07:38 25 4
gpt4 key购买 nike

如何在UITableView中为每一行设置不同的副标题

subArray = [[NSArray alloc] initWithObjects:@"Red", @"Blue", @"Green" , @"Yellow", nil];

cell.detailTextLabel.text=[self->subArray objectAtIndex:indexPath.row];

return [self->subArray count];

这就是我所做的,但出于某种原因,我无法在 UITabelView 中看到文本,除非我将代码更改为 cell.textlabel.text

最佳答案

UITableViewCell样式设置为UITableViewCellStyleSubtitle

例如

 if(!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
}

关于ios - 向 UITableView 添加字幕数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36152758/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com