我正在使用表格视图来显示列表。只有一个单元格会有UITableViewCellStyleValue1. 问题是向上/向下滚动时,详细的文本显示不好。这是代码。
// 自定义表格视图单元格的外观。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
静态 NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
如果(细胞 == 零){
如果(indexPath.row == 0)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 重用Identifier:CellIdentifier] autorelease];
cell.textLabel.textColor = [UIColor whiteColor];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
cell.detailTextLabel.textColor = [UIColor yellowColor];
cell.detailTextLabel.text = @"描述";
}
别的
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.textColor = [UIColor whiteColor];
cell.accessoryType = UITableViewCellAccessoryNone;
}
}
// 配置单元格。
cell.textLabel.text = [radioList objectAtIndex:indexPath.row];
返回单元格;
}
有人能帮我吗?