您的位置:首页 > 移动开发 > Swift

swift 学习笔记 UITableView (一)Table View Styles and Accessory Views

2016-10-10 16:30 921 查看
Table View Styles 和 附属的views

Table View有各种不同的Style去match不同的porpose, 而且, UIKit framework提供了标准的Style,同样也为cell提供了标准的子view。

table View Styles

根据外观可以区分成两个table view: Plain 和 Grouped

Plain table view:

如下图,一个plain table view可以有一个或多个section, 每个section可以有一个或多个row,每个色彩体噢内可以有自己的header  & footer( header和footer也可以包含custom view, 比如图片), 当用户在section中滚动时,header和footer会浮动在上/下屏幕



以下为plain table view中的贵族,indexed list. 



plain table view中的鳥丝:



Grouped table Views

下面介绍table View中的战斗view Grouped table view, 区别于plain 他的背景不是单纯的白,他的背景会被分开来



section的成分:



不同的UITableView Cell Style

以下为四多金花老大: 
UITableViewCellStyleDefault
 



老二:UITableViewCellStyleSubtitle



三:
UITableViewCellStyleValue1
 



四:
UITableViewCellStyleValue2
 



阿克塞萨日(已炸): Accessory Views

Standard accessory views
Description


Disclosure indicator—
UITableViewCellAccessoryDisclosureIndicator
.
You use the disclosure indicator when selecting a cell results in the display of another table view reflecting the next level in the data model hierarchy.


Detail disclosure button—
UITableViewCellAccessoryDetailDisclosureButton
.
You use the detail disclosure button when selecting a cell results in a detail view of that item (which may or may not be a table view).


Checkmark—
UITableViewCellAccessoryCheckmark
.
You use a checkmark when a touch on a row results in the selection of that item. This kind of table view is known as a selection list, and it is analogous to a pop-up list. Selection lists can limit selections to one row, or they can allow multiple rows with
checkmarks.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  swift