zoukankan      html  css  js  c++  java
  • UITableView-FDTemplateLayoutCell自动计算UITableView高度的使用

    基本应用
    如果你有self-satisfied cell,那么你应该做的是:
    #import "UITableView+FDTemplateLayoutCell.h"
    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        return [tableView fd_heightForCellWithIdentifier:@"reuse identifer" configuration:^(id cell) {
            // Configure this cell with data, same as what you've done in "-tableView:cellForRowAtIndexPath:"
            // Like:
            //   cell.model = self.datas[index.row];

        }];
    }


    进阶应用(iOS7下也能用)
    Since iOS8, -tableView:heightForRowAtIndexPath: will be called more times than we expect, we can feel these extra calculations when scrolling. So we provide another extension with caches:

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        return [tableView fd_heightForCellWithIdentifier:@"identifer" cacheByIndexPath:indexPath configuration:^(id cell) {
            // configurations
        }];
    }

  • 相关阅读:
    protobuf自解释message
    protobuf编码
    proto3语法
    proto2语法
    protobuf简介
    poi处理大EXCEL文件总结
    POI-处理大Excel文件(xlsx写)
    POI-处理大Excel文件(xlsx)
    POI-处理大Excel文件(xls)
    RedHat 6.4 RHCS GFS2安装
  • 原文地址:https://www.cnblogs.com/Rinpe/p/5032154.html
Copyright © 2011-2022 走看看