UITableView开发流程

来源:互联网 发布:webshell采集器 编辑:程序博客网 时间:2024/05/22 03:08
#pragma mark 1.有多少组
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
* 返回2

#pragma mark 2.第section组头部控件有多高
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
* section == 0 返回0
* section == 1 返回标题栏的高度(44)

#pragma mark 3.第section组有多少行
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
* section == 0 返回1
* section == 1
* 如果当前是第一组,返回第一组数量
* 如果当前是第二组,返回第二组数量

#pragma mark 4.indexPath这行的cell有多高
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
* section == 0 返回cell的高度
* section == 1
* 如果当前是第一组,返回第一组高度
* 如果当前是第二组,返回第二组高度

#pragma mark 5.indexPath这行的cell长什么样子
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
* section == 0 返回微博cell
* section == 1


#pragma mark 6.第section组头部显示什么控件
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
* section == 0 返回nil
* section == 1 返回标题栏控件


0 0
原创粉丝点击