ios开发 uitableviewcell点击当前cell的背景颜色怎么改变

 我来答
闲雅且灵活丶仙人掌D
2017-11-08 · 超过26用户采纳过TA的回答
知道答主
回答量:126
采纳率:88%
帮助的人:41.3万
展开全部
自定义颜色和背景设置
改变UITableViewCell选中时背景色:
UIColor *color = [[UIColoralloc]initWithRed:0.0green:0.0blue:0.0alpha:1];//通过RGB来定义自己的颜色
[html] view plaincopyprint?
01.cell.selectedBackgroundView = [[[UIView alloc] initWithFrame:cell.frame] autorelease];
02.cell.selectedBackgroundView.backgroundColor = [UIColor xxxxxx];
cell.selectedBackgroundView = [[[UIView alloc] initWithFrame:cell.frame] autorelease];
cell.selectedBackgroundView.backgroundColor = [UIColor xxxxxx];
3自定义UITableViewCell选中时背景
[html] view plaincopyprint?
01.cell.selectedBackgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cellart.png"]] autorelease];
02.还有字体颜色
03.cell.textLabel.highlightedTextColor = [UIColor xxxcolor]; [cell.textLabel setTextColor:color];//设置cell的字体的颜色
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式