为什么我的ImageView仅在单元格突出显示时可见?

时间:2013-01-31 14:27:27

标签: iphone interface-builder

我的TableView有一个自定义Cell,上面有一个ImageView。

enter image description here

为什么ImageView只在单元格突出显示时才可见?

enter image description here

如此创建细胞:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];

    Site *site = [self.dataController objectInListAtIndex:indexPath.row];

    [[cell textLabel] setText:site.description];
    return cell;
}

2 个答案:

答案 0 :(得分:2)

退房:Custom UITableViewCell (IB) only shows in selected state

它的快速概要“填写标准的UITableViewCell.textLabel.text似乎覆盖了PrototypeCells”。因此,您似乎必须创建并添加不同的文本标签。

答案 1 :(得分:0)

也许您的UIImageView是突出显示的背景视图的子视图,只有在选中此单元格后才会显示?