iOS UITableViewCell选中后的颜色设置
来源:互联网 发布:手办原型师 知乎 编辑:程序博客网 时间:2024/05/17 22:39
1.系统默认的颜色设置
1 //无色2 cell.selectionStyle=UITableViewCellSelectionStyleNone;3 //蓝色,也就是系统默认的颜色4 cell.selectionStyle=UITableViewCellSelectionStyleBlue;5 //灰色6 cell.selectionStyle=UITableViewCellSelectionStyleGrap;
2.自定义UITableViewCell选中后的背景颜色和背景图片
1 UIColor* color=[[UIColor alloc]initWithRed:0.0 green:0.0 blue:0.0 alpha:1];//通过RGB来定义颜色2 cell.selectedBackgroundView=[[UIView alloc]initWithFrame:cell.frame]autorelease];3 cell.selectedBackgroundView.backgroundColor=[UIColor ***]或color;4 5 自定义选中后的背景图片6 cell.selectedBackgroundView=[[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"123.png"]]autorelease];7 设置UITableViewCell中的字体颜色时用8 cell.textLabel.highlightedTextColor=[UIColor **color];
3.定义UITableViewCell的样式
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
不设置accessoryType时是这样的
设置accessoryType后是这样的
accessoryType有如下几种
typedef enum { UITableViewCellAccessoryNone, UITableViewCellAccessoryDisclosureIndicator, UITableViewCellAccessoryDetailDisclosureButton, UITableViewCellAccessoryCheckmark} UITableViewCellAccessoryType;
4.隐藏UITableViewCell的分隔线
[chatTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; UITableViewCellSeparatorStyle有如下几种 typedef enum { UITableViewCellSeparatorStyleNone, UITableViewCellSeparatorStyleSingleLine, UITableViewCellSeparatorStyleSingleLineEtched} UITableViewCellSeparatorStyle;
5设置UITableViewCell之间分隔线的颜色
[chatTableViewsetSeparatorColor:[UIColor blueColor]];
还有其他颜色可以设置,你们可以自已试试
原文地址:
http://blog.csdn.net/a6472953/article/details/7532212
0 0
- iOS UITableViewCell选中后的颜色设置
- ios中UITableViewCell选中后的颜色设置
- ios中UITableViewCell选中后的颜色设置
- ios中UITableViewCell选中后的颜色设置和背景图片
- ios中UITableViewCell选中后的颜色设置
- 设置UITableViewCell选中的颜色
- 设置UITableViewCell选中的颜色
- 设置UITableViewCell选中的颜色
- cellForRowAtIndexPath UITableViewCell 选中后的背景颜色设置
- IOS UITableViewCell的选中时的颜色设置
- iOS开发之UITableViewCell的选中时的颜色设置
- iOS开发UITableViewCell的选中时的颜色设置
- iOS开发UITableViewCell的选中时的颜色设置
- iOS开发UITableViewCell的选中时的颜色设置
- iOS开发UITableViewCell的选中时的颜色设置
- iOS开发UITableViewCell的选中时的颜色设置
- iOS开发UITableViewCell的选中时的颜色设置
- iOS开发中设置UITableViewCell选中时的颜色
- ThinkPHP控制器间实现相互调用的方法||ThinkPHP实现跨模块调用操作方法概述
- 基于restful注解(spring4.0.2整合flex+blazeds+spring-mvc)
- Flightgear操作方式以及几种典型飞机的起飞方法
- Subsets II
- html学习教程5之框架
- iOS UITableViewCell选中后的颜色设置
- HDU 1175 连连看(BFS)
- PYTHON招聘需求与技能体系
- 超级台阶
- 20150310-Allegro全局替换过孔的方法
- 声音图标有时候显示有时候没有
- 凑14
- apache+tomcat的乱码解决
- JavaSe——IO流_Part3