iOS defines four table-cell styles that
implement the most common layouts for table rows in both plain and
grouped tables. Each cell style is best suited to display a different
type of information.
Note:
Programmatically,
these styles are applied to a table view’s cell, which is an object
that tells the table how to draw its rows.
Default
(UITableViewCellStyleDefault
). The default cell style includes an optional image in the left end of the row, followed by a left-aligned title in black.
In
the default cell style, the text label’s appearance implies that it
represents an item name or title and its left-alignment makes the list
easy to scan. This makes the default style good for displaying a list of
items that do not need to be differentiated by supplementary
information.
Subtitle
(UITableViewCellStyleSubtitle
).
The subtitle style includes an optional image in the left end of the
row, followed by a left-aligned title on one line and a left-aligned
subtitle on the line below. The title is in black and the subtitle is in
a smaller, gray font.
In
the subtitle cell style, the prominent appearance of the text label
implies that it represents an item name or title, whereas the subtle
appearance of the detail text label implies that it contains subsidiary
information related to the item. The left-alignment of the text labels
makes the list easy to scan. This table-cell style works well when list
items look similar, because users can use the additional information in
the detail text labels to help distinguish items named in the text
labels.
Value 1
(UITableViewCellStyleValue1
).
The value 1 style displays a left-aligned title in black on the same
line with a right-aligned subtitle in a smaller, blue font. Images do
not fit well in this style.
In
the value 1 cell style, the appearance of the text label implies that
it represents an item name or title, whereas the appearance of the
detail text label implies that it provides important information that is
closely associated with the item.
The left-alignment and font of
the text label help users scan the list for the item they want, and the
right-alignment of the detail text label draws their attention to the
related information it provides. This table-cell style works well to
display an item’s current value, possibly selected from a sublist.
Value 2
(UITableViewCellStyleValue2
).
The value 2 style displays a right-aligned title in a small, blue font,
followed on the same line by a left-aligned subtitle in a larger, black
font. Images do not fit well in this style.
In
the value 2 cell style, the right-alignment, constrained width, and
font of the text label imply that it functions as a heading or caption
for the important information in the more prominent, left-aligned detail
text label.
In this layout, the labels are aligned towards each
other at the same location in every row. This creates a crisp, vertical
margin between the text labels and the detail text labels in the list,
which helps users focus on the first words of the detail text label.
Note:
All
four standard table-cell styles also allow the addition of a table-view
element, such as the checkmark or the disclosure indicator. Adding
these elements decreases the width of the cell available for the title
and subtitle.
分享到:
相关推荐
主要介绍了IOS UITableView和UITableViewCell的几种样式详细介绍的相关资料,需要的朋友可以参考下
自定义UITableViewCell。实现各种样式的表格输入界面ios源代码设计资料
UITableViewCell自定义等高
UITableViewCell的四种不同的定制单元格方式
iOS UITableViewCell 单选 Button设置image
手写代码自定义UITableViewCell和xib自定义UITableViewCell的DEMO,适合初学者学习。
UITableViewCell动画效果
我们通过代码来探索UITableViewCell重用的实现
利用原始UITableViewcell强大的自适应性能,改造UITableViewcell,与自定义UITableViewcell略有不同
IOS源码——自定义UITableViewCell。实现各种样式的表格输入界面.7z
UITableViewCell 自动调节高度
优化UITableViewCell滚动性能,使用到Loren Brichter在Twitter中写到得关于UITableViewCell流畅滚动的内容。
NULL 博文链接:https://justsee.iteye.com/blog/2208725
上篇文章介绍了如何用UITableView显示表格,并讲了几种UITableViewCell的风格。不过有时候我们需要自己定义UITableViewCell的风格,其实就是向行中添加子视图。添加子视图的方法主要有两种:使用代码以及从.xib文件...
IOS源码——自定义UITableViewCell。实现各种样式的表格输入界面.zip
UITableviewCell高度自适应
通过自定义UITableViewCell实现ibooks的图书列表样式。
Xib设计UITableViewCell然后动态加载例子,对应博客贴子地址: http://blog.csdn.net/duanyipeng/article/details/7259108