首页 > 移动平台 > 详细

iOS:改变UITableViewCell的选中背景色

时间:2014-09-19 13:35:35      阅读:273      评论:0      收藏:0      [点我收藏+]

要改变UITableViewCell选中时的背景色,需要在
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)方法中添加如下代码:

// 设置cell选中的背景色
UIView *selectionColor = [[UIView alloc] init];
selectionColor.backgroundColor = [UIColor colorWithRed:(2/255.0)
                                                 green:(94/255.0)
                                                  blue:(130/255.0)
                                                 alpha:1];
cell.selectedBackgroundView = selectionColor;

即可。

iOS:改变UITableViewCell的选中背景色

原文:http://www.cnblogs.com/ilovewindy/p/3977907.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!