天天看點

iOS - UIRefreshControl 重新整理資料前言1、UIRefreshControl2、refreshControl 的使用

UITableViewController 自帶重新整理控件。

使用 StoryBoard 建立的表格視圖控制器可在 SB 的 TableViewController 中将 Refreshing 項設定為 Enableed,在控件為清單中将自動添加一個名為 Refresh Control 的控件,将該控件連接配接到代碼中的自定義加載資料方法,即可實作重新整理資料的操作。

純代碼建立的 TableViewController 可以直接使用 self.refreshControl = [[UIRefreshControl alloc] init]; 執行個體化重新整理控件。然後向 self.refreshControl 中添加自定義加載資料方法,即可實作重新整理資料的操作。

iOS - UIRefreshControl 重新整理資料前言1、UIRefreshControl2、refreshControl 的使用
iOS - UIRefreshControl 重新整理資料前言1、UIRefreshControl2、refreshControl 的使用
iOS - UIRefreshControl 重新整理資料前言1、UIRefreshControl2、refreshControl 的使用

執行個體化重新整理控件

設定重新整理控件屬性

開始/停止重新整理

Objective-C

VideoModel.h

VideoCell.h

VideoCell.m

ViewController.h

ViewController.m

繼續閱讀