我試過設置未選定表格單元格的背景圖像的多種方式,但沒有成功:設置背景圖片
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"];
似乎都失敗。所選單元的圖像設置適用,但不適用於未選定單元。任何人有任何想法在這裏可能是錯誤的?
感謝
格里可以請您給一些示例代碼。非常感謝。 – msk 2010-02-16 08:42:05
cell.backgroundImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@「foo.png」]]; – 2010-03-05 16:31:24
我相信上面會泄漏 - 在末尾添加一個autorelease – TomH 2011-05-18 16:12:35