我尝试了多种方法来设置未选定的表格单元格的背景图像,但没有成功:
1- In IB setting the image field
2- cell.contentView.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"list.png"]];
3- cell.imageView.image = [UIImage imageNamed:@"list_selected.png"];
一切似乎都失败了。选定单元格的图像设置有效,但不适用于未选定的单元格。有人知道这里可能出了什么问题吗?
Thanks
尝试将backgroundView设置为图像的imageView。
Jason Moore 的代码示例(经过 TomH 的修正):
cell.backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"foo.png"]] autorelease];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)