
ios开发 uitableviewcell点击当前cell的背景颜色怎么改变
1个回答
展开全部
自定义颜色和背景设置
改变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的字体的颜色
改变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的字体的颜色
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询