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;
      }
     
  • 相关阅读:
    PICT安装及使用
    Linux 压缩和解压缩常用命令
    ICTCLAS 汉语词性标注集
    基于MPI的并行计算—矩阵向量乘
    Python 主成分分析PCA
    Python 利用pytesser模块识别图像文字
    华为HG255D路由器使用OH3C进行中大校园网认证
    Kubuntu 使用YaH3C进行中大校园网认证
    PHP 调用Python脚本
    Python 调用百度翻译API
  • 原文地址:https://www.cnblogs.com/feiyu-mdm/p/5555101.html
Copyright © 2011-2022 走看看