表视图数据未填充

时间:2013-04-23 07:37:15

标签: iphone xcode4.5

设置单元格背景图像时,我的表格视图数据(即填充在数组中)未加载。但它在细胞背景图像中工作正常。

2 个答案:

答案 0 :(得分:1)

使用

设置背景图像
UIImageView *imgView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yourImage.png"]];

[cell setBackgroundView:imgView];

答案 1 :(得分:0)

如果可能,您还没有在此发布表格视图方法的代码,而不是发布它。

我认为如果Cell图像颜色与您正在显示的内容的文本颜色匹配,那么它将在那里但不可见。

如果您已通过此代码添加了Cell image,那么第二件事:

[cell.contentView addSubview:cellImage];

&安培;如果你已经在文本内容下面编写了CellImage代码,那么也不会显示它。

希望这会有所帮助。