【问题标题】:iOS – Animate UITableView deselectRow.. with selectedBackgroundViewiOS – 使用 selectedBackgroundView 动画 UITableView deselectRow..
【发布时间】:2012-08-11 16:47:21
【问题描述】:

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

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

【问题讨论】:

    标签: uitableview uiimageview selection


    【解决方案1】:

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

    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;
    

    也许它会适合你

    【讨论】:

    • 是的,我知道如何设置selectedBackgroundView。我在问如何将UIImageView 从选中变为未选中。
    猜你喜欢
    • 2019-11-12
    • 2014-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-15
    • 2012-04-19
    • 2018-02-28
    • 1970-01-01
    相关资源
    最近更新 更多