zoukankan      html  css  js  c++  java
  • iOS开发之UITableViewController重写

     # UITablViewController方法的使用介绍


    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // 返回单元格数 }
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        // 返回表视图行数
    }
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
      // 返回每个单元格
    }

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
       // 选中单元格操作
    }

    #pragma mark - EditMode
    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
    {
      // 返回可以编辑
        return YES;
    }

    - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
    {  // 返回删除样式
        return UITableViewCellEditingStyleDelete;
    }

    -(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
      // 返回删除 标题
        return @"删除";
    }

    -(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
    {
       // 删除执行操作
    }
     
  • 相关阅读:
    Mininet介绍及安装
    第9周学习进度
    团队效绩计划
    第一阶段冲刺个人博客10
    第一阶段冲刺个人博客09
    第一阶段冲刺个人博客08
    win10自带中文输入法的用户体验
    团队项目冲刺第十天
    构建之法阅读笔记02
    团队项目冲刺第九天
  • 原文地址:https://www.cnblogs.com/ht-927/p/4283449.html
Copyright © 2011-2022 走看看