-1
我怎樣才能在表我如何能在表中添加圖像爲每個按鈕
我有表中8個按鈕添加一個圖像的每一個按鈕,我希望把不同的圖像爲每個按鈕
我有這樣的代碼可以如何修改以接受8個圖像
- (UIImage *)cellBackgroundForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSInteger rowCount = [self tableView:[self tableView] numberOfRowsInSection:0];
NSInteger rowIndex = indexPath.row;
UIImage *background = nil;
if (rowIndex == 0) {
background = [UIImage imageNamed:@"Button01.png"];
} else if (rowIndex == rowCount - 1) {
background = [UIImage imageNamed:@"Button02.png"];
} else {
background = [UIImage imageNamed:@"Button03.png"];
}
return background;
}