• 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;
      }
     
  • 相关阅读:
    LightOJ 1313
    LightOJ 1285
    [坑] treap
    HDU 4511 小明系列故事——女友的考验 (AC自动机+DP)
    ZOJ 3765 Lights (伸展树splay)
    HDU 4818 RP problem (高斯消元, 2013年长春区域赛F题)
    SGU 104. Little shop of flowers (DP)
    HDU 3472 HS BDC (混合图的欧拉路径判断)
    POJ 1386 Play on Words (有向图欧拉路径判定)
    微信小程序上架需要增值电信业务经营许可证ICP?
  • 原文地址:https://www.cnblogs.com/feiyu-mdm/p/5555101.html
Copyright © 2020-2023  润新知