iOS - 使用selectedBackgroundView动画UITableView deselectRow ..

时间:2012-08-11 08:40:06

标签: uitableview uiimageview selection

当单元格的UITableView- deselectRowAtIndexPath:animated时,是否可以selectedBackgroundView动画UIImageView

我想让图像淡出,就像填充颜色一样。

1 个答案:

答案 0 :(得分:0)

在我的项目中,我有选定状态的图片并以这种方式实现:

UIView *background = [[UIView alloc] initWithFrame:cell.frame];
background.backgroundColor = [UIColor colorWithRed:239/255.0 green:237/255.0 blue:231/255.0 alpha:1.0];
cell.backgroundView = background;

UIView *selectedBackground = [[UIView alloc] initWithFrame:cell.frame];
selectedBackground.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"selecetedCell.png"]];
cell.selectedBackgroundView = selectedBackground;

也许它适合你