您的位置:首页 > 其它

关于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的字体偏小偏蓝。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: