swift 學習筆記 UITableView (一)Table View Styles and Accessory Views

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. 


A table view configured as an indexed list


plain table view中的鳥絲:


A table view configured as an selection list


Grouped table Views


下面介紹table View中的戰鬥view Grouped table view, 區別於plain 他的背景不是單純的白,他的背景會被分開來


A table view in the grouped style


section的成分:


Header and footer of a section



不同的UITableView Cell Style


以下爲四多金花老大: UITableViewCellStyleDefault 



老二:UITableViewCellStyleSubtitle




三:UITableViewCellStyleValue1 



四:UITableViewCellStyleValue2 




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


Standard accessory views

Description

Disclosure indicator

Disclosure indicatorUITableViewCellAccessoryDisclosureIndicator. 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

Detail disclosure buttonUITableViewCellAccessoryDetailDisclosureButton. 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).

Check mark

CheckmarkUITableViewCellAccessoryCheckmark. 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.



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章