zoukankan      html  css  js  c++  java
  • 关于UITableView的若干方法-15-05-07

     1—   self.carTableView.dataSource = self;    

              ——要设置数据源才能进行对列表相关设置。

    2—-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView  

              ———设置总的有几组数据

    3—-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section  

              ————设置第section组有几个数据

    4—-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath   

              ——设置indexpath的数据,其中indexpath为结构体,有section和row成员

    5—    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];  

    6—  UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];

              ——新建类型为UITableViewCellStyleSubtitle,标识为ID的cell

    7— 类型为UITableViewCellStyleSubtitle的UITableViewCell有三个成员可以进行图片,文本,详细文本的赋值。imageView——textLabel ——detailTextLabel

                   UITableViewCell内部有个默认的子视图:contentView,以上均为contentview的子控件。

    8—-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath  

              ——当列表中某行被点击时会调用该代理方法。

    9— - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView

              ——代用该方法会生成右边索引条

    补充——辅助指示视图的作用是显示一个表示动作的图标,可以通过设置UITableViewCell的accessoryType来显示

              ——从缓存中取出标识为ID的UITableViewCell的内存,进行重新赋值

  • 相关阅读:
    【Emit基础】IL定义方法的语法详解
    Audit login 与 Audit logout
    锁定与并发
    【Emit基础】调用Tostring()方法的IL表示
    《DataRabbit 完全手册V1.0》 发布
    Remoting方法重载遇到的一个问题
    DataRabbit 3.1发布,完全支持SqlServer2005/2008
    A*算法的C#实现
    Spring.net 的一个bug ?
    【Emit基础】System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
  • 原文地址:https://www.cnblogs.com/tusiji7/p/4486327.html
Copyright © 2011-2022 走看看