zoukankan      html  css  js  c++  java
  • tableview封装使用

    下载地址

    使用方法

      

       1. #import "ZFTableView.h"
      2.在需要使用的地方添加ZFTableView 如下
       
      ZFTableView *tab = [[ZFTableView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
      tab.cellInfos = self.infos;
      tab.separatorStyle = UITableViewCellSeparatorStyleNone;
      [self.view addSubview:tab];
       
      self.infos 是tableview的数据
       
      3.添加数据
       
      传入数据必须为包含ZFTableViewCellModel或子类型的数组
      传入cellName表示cell为代码创建的cell
      传入xibCellName表示cell为xib创建的cell
      自定义cell需要继承自ZFTableViewCell
       
      如需使用tableView其他功能,请重写delegate方法
       
      -(NSMutableArray *)infos{
       
      if (_infos == nil) {
      NSMutableArray *arr =[NSMutableArray arrayWithObjects:@"ZFCollectionViewLayoutCircleType",@"ZFCollectionViewLayoutStackType",@"ZFCollectionViewFlowLayoutRotatePageType",@"ZFCollectionViewFlowLayoutWaterfallType",@"ZFCollectionViewFlowLayoutLineType", nil];
      NSMutableArray *arr1 =[NSMutableArray arrayWithCapacity:1];
       
      for (int i =0; i < arr.count; i++) {
       
      ZFTableViewCellModel *model = [[ZFTableViewCellModel alloc] init];
      model.title = arr[i];
      model.PopToViewController = [NSString stringWithFormat:@"%@ViewController",arr[i]];
      // if (i != 1) {
      // model.cellName =@"demoTableViewCell";
      // }else{
       
      model.xibCellName =@"demo1TableViewCell";
       
      // }
       
      // model.imgName =[NSString stringWithFormat:@"%i",i];
      [arr1 addObject:model];
      }
      _infos = arr1;
      }
       
      return _infos;
      }
     
  • 相关阅读:
    c#泛型的使用
    关于Asp.net无法写入输出文件的原因
    利用OLEDB导出数据到Excel
    中秋祝福
    C#获取当前域用户名
    【程序员必读】骨灰级程序员20条编程经验
    SQL SERVER 2005无法远程连接的问题
    ASP.Net 实现伪静态方法及意义
    js+ajax获取文件大小
    C#遍历指定文件夹中的所有文件
  • 原文地址:https://www.cnblogs.com/feiyu-mdm/p/5555101.html
Copyright © 2011-2022 走看看