【发布时间】:2014-01-23 19:20:18
【问题描述】:
我想在选择单元格时更改单元格的背景图像。
我已经尝试过这种语法:
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath{
//for adding image
cell.ImgCateg.image=[UIImage imageNamed:[ImgArr objectAtIndex:indexPath.row]];
...
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
CRHomeCategCell *cell = (CRHomeCategCell*)[_tblCateg cellForRowAtIndexPath:indexPath];
cell.ImgCateg.image = [UIImage imageNamed:@"DefaultBg.png"];
}
这会改变前景中的图像而不是背景。
请提前帮助和感谢。
【问题讨论】:
标签: ios iphone ipad uitableview uiimageview