UITableView作為iOS非常重要的一部分伏伯,應(yīng)當(dāng)著重討論
UITableView 學(xué)習(xí)地圖
基本用法-->cell定制-->編輯模式-->分區(qū)索引
Initializing a UITableView Object 初始化一個(gè)UITableView 的對(duì)象
Configuring a Table View 對(duì)一個(gè)Table View進(jìn)行配置
Creating Table View Cells 創(chuàng)建一個(gè)cell
Accessing Header and Footer Views?訪問header和footer視圖
Accessing Cells and Sections 訪問Cell和Section
Estimating Element Heights 元素高度的大概值
Scrolling the Table View 滾動(dòng)表視圖
Managing Selections 管理section
Inserting, Deleting, and Moving Rows and Sections? 插入、刪除和移動(dòng)row和Section
Managing the Editing of Table Cells 管理table里的cell的編輯
Reloading the Table View 重載表視圖
Managing the Delegate and the Data Source 管理委托和數(shù)據(jù)源
Configuring the Table index 配置table的索引
幾個(gè)知識(shí)點(diǎn)的解釋:
1. prepareForSegue 在viewDidLoad之前
viewController 是輕量級(jí)的恢口,而view很耗資源稚铣,所以VC直到訪問viewController.view時(shí)才會(huì)被加載進(jìn)來,在此之后才會(huì)有viewDidLoad,在加載進(jìn)之前,outlet沒有做connection漱受,所以訪問一定是nil。雖然這個(gè)問題在很久之前就已經(jīng)發(fā)現(xiàn)并解決患整,但這種曾經(jīng)的錯(cuò)誤仍然是不適合實(shí)現(xiàn)的拜效。歸根結(jié)蒂的原因,VC和VC之間只可傳消息各谚、數(shù)據(jù),如果互知對(duì)方“底細(xì)”到千,兩個(gè)VC之間就沒有劃分的必要了昌渤。
2. static cell
僅嵌在UITableController 里可以使用
優(yōu)勢(shì)一:有的界面,需要使用表格外觀憔四,卻不需要數(shù)據(jù)動(dòng)態(tài)膀息,如setting。
優(yōu)勢(shì)二:靜態(tài)表格下拉刷新(iOS6+)
3. UITableView的交互
->選擇
->進(jìn)入編輯模式了赵,增加/刪除行的處理
->數(shù)據(jù)變化如何刷新界面
擴(kuò)展:如何劃動(dòng)刪除潜支?