首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS -动画UITableView deselectRow..使用selectedBackgroundView

iOS -动画UITableView deselectRow..使用selectedBackgroundView
EN

Stack Overflow用户
提问于 2012-08-11 16:40:06
回答 1查看 209关注 0票数 0

当单元格的selectedBackgroundViewUIImageView时,是否可以让UITableView- deselectRowAtIndexPath:animated设置动画

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

EN

回答 1

Stack Overflow用户

发布于 2012-08-11 16:47:22

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

代码语言:javascript
复制
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;

也许它会适合你

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11913269

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档