首页 > 技术文章 > iOS cell添加点击时改变字体的颜色及背景

anyezhuixing 2015-06-03 17:04 原文

        cell.selectedBackgroundView.backgroundColor = [UIColor whiteColor];//选中后变换,色彩的变换
        cell.textLabel.highlightedTextColor = [UIColor colorWithRed:0/255.0 green:180/255.0 blue:140/255.0 alpha:1];//选中label颜色的变化
        cell.textLabel.textColor = [UIColor whiteColor];

        cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fenlei-weidaidi"]];
        cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fenlei-daidi"]];//选中后变换,图片的变换

 

推荐阅读