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;
      }
     
  • 相关阅读:
    info plist各个功能的详解
    打个测试包弄成连接供别人下载测试
    封装的数据请求加上风火轮的效果
    福大软工 · BETA 版冲刺前准备(团队)
    福大软工 · 第十一次作业
    Alpha 冲刺 (10/10)
    Alpha 冲刺 (9/10)
    Alpha 冲刺 (8/10)
    Alpha 冲刺 (7/10)
    Alpha 冲刺 (6/10)
  • 原文地址:https://www.cnblogs.com/feiyu-mdm/p/5555101.html
Copyright © 2011-2022 走看看