清除UITableViewCell的背景颜色?

时间:2011-12-29 09:08:32

标签: iphone ipad uipopovercontroller uitableview

我在UITableView部分加载所有数据。 我得到上面的屏幕的结果。我想删除表格单元格的黑色补丁(背景颜色)。 为此,我在cellForRowAtIndexPath方法中编写以下代码

cell.backgroundColor = [UIColor whiteColor];
[cell setOpaque:NO];
NSDictionary *name = [[self.sections valueForKey:[[[self.sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
[cell.textLabel setFont:[UIFont systemFontOfSize:15.0f]];
[cell.textLabel setText:[name objectForKey:@"Name"]];  

我的nib文件是enter image description here

我仍然给出相同的结果。此代码和笔尖设置在iPhone模拟器上运行良好,但在iPhone中无效。 请问为什么会发生这种情况,我会走错路? 我如何删除这个问题?

先谢谢了。

2 个答案:

答案 0 :(得分:3)

更改背景视图,在笔尖中,使其清晰为彩色或白色

也试试

方法CellForRowAtIndexPath中的

,如tableView.backgroundColor = [UIColor clearColor];

答案 1 :(得分:0)

RRB

你必须设置tableView.backgroundColor运行时的clearColor 不在xib