zoukankan      html  css  js  c++  java
  • UITableViewdataSourse的协议所有方法

    UITableViewDataSource

    @required
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;分区一共有多少行
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
    创建第section分区第row行的UITableViewCell对象(indexPath包含了section和row)


    @optional
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
    一共有多少个分区


    - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;
    第section分区的头部标题


    - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;
    第section分区的底部标题


    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath;
    某一行是否可以编辑(删除)


    - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath;
    某一行是否可以移动来进行重新排序


    - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;
    UITableView右边的索引栏的内容


    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    选中了UITableView的某一行


    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    某一行的高度


    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
    第section分区头部的高度


    - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
    第section分区尾部的高度


    - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
    第section分区头部显示的视图


    - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
    第section分区尾部显示的视图


    - (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath
    设置每一行的等级缩进(数字越小,等级越高)

  • 相关阅读:
    第二次团队介绍
    团队介绍
    随手记解决的问题
    iOS 接入支付 --- 支付宝支付
    GCD 以及设计模式
    iOS 小技巧总结
    tabBar 的上拉隐藏,上拉显示实现
    iOS开发---冷门小技巧
    iOS开发:盘点常用的几种设计模式 --(转自 liwei3gjob的专栏)
    OC --(9)-- 内存管理初级:内存管理的方式、引用计数机制,影响计数的各个方法、dealloc方法、内存管理的基本原则、掌握copy的实现
  • 原文地址:https://www.cnblogs.com/mafeng/p/5289294.html
Copyright © 2011-2022 走看看