关于cell的那点事
2015-12-25 17:10
211 查看
我们整天在做项目的时候,基本上都会用到,tableView,继而会用到tableViewCell,那么cell究竟是怎么回事呢?我今天和大家一块探讨一下cell的那点事 ,不喜轻喷。
typedefNS_ENUM(NSInteger, UITableViewCellStyle) {
UITableViewCellStyleDefault,// Simple cell with text label and optional image view (behavior of UITableViewCell in iPhoneOS 2.x)
UITableViewCellStyleValue1,// Left aligned label on left and right aligned label on right with blue text (Used in Settings)
UITableViewCellStyleValue2,// Right aligned label on left with blue text and left aligned label on right (Used in Phone/Contacts)
UITableViewCellStyleSubtitle// Left aligned label on top and left aligned label on bottom with gray text (Used in iPod).
};
第一种就是默认cell,这是最简单的,左边是一个imageView(可选),右边是一个label;只有图标和主标题。
第二种就是左边一个imageView,中间一个label,右边一个label(常用于设置);Value1样式,有主标题和副标题,主标题左对齐,如果有副标题,那么副标题是右对齐的。
第三种就是左边一个label,字体蓝色偏小,右边一个label,字体偏大偏黑;Value2样式,主标题和副标题,主标题和副标题是居中对齐的。
第四种就是有副标题的cell,左边一个imageView,右边是上下两个label,上边的label字体偏大偏黑,下边label的字体偏小偏蓝。
typedefNS_ENUM(NSInteger, UITableViewCellStyle) {
UITableViewCellStyleDefault,// Simple cell with text label and optional image view (behavior of UITableViewCell in iPhoneOS 2.x)
UITableViewCellStyleValue1,// Left aligned label on left and right aligned label on right with blue text (Used in Settings)
UITableViewCellStyleValue2,// Right aligned label on left with blue text and left aligned label on right (Used in Phone/Contacts)
UITableViewCellStyleSubtitle// Left aligned label on top and left aligned label on bottom with gray text (Used in iPod).
};
第一种就是默认cell,这是最简单的,左边是一个imageView(可选),右边是一个label;只有图标和主标题。
第二种就是左边一个imageView,中间一个label,右边一个label(常用于设置);Value1样式,有主标题和副标题,主标题左对齐,如果有副标题,那么副标题是右对齐的。
第三种就是左边一个label,字体蓝色偏小,右边一个label,字体偏大偏黑;Value2样式,主标题和副标题,主标题和副标题是居中对齐的。
第四种就是有副标题的cell,左边一个imageView,右边是上下两个label,上边的label字体偏大偏黑,下边label的字体偏小偏蓝。
相关文章推荐
- centos普通用户设置sudo权限
- 周记——20151221
- 前端代码指南(二)
- 前端代码指南(一)
- BeginInvoke、ThreadPool、Task三类异步方法的区别和速度比较
- 查看Oracle有哪些表或者视图
- MyEclipse设置java文件每行字符数
- Java反射的简单使用
- esasyui 和 KindEditor 在同一页面,input无法获得焦点,无法输入
- linux xia shan chu wenjian
- 生成COM Dll的tlb文件的两种方法
- Mybatis缓存
- 利用npoi生成word
- JSON-lib框架,转换JSON、XML不再困难
- Spring中提示元素 'ref' 中不允许出现属性 'local'
- Android开发之ListView实现Item局部刷新
- 使用show profile分析单条查询
- mybatis基础教程
- 最简单的log4j配置文件
- C++数据结构之图的深度和广度遍历