文章来源:淘论文网   发布者: 毕业设计   浏览量: 20



还可以点击去查询以下关键词:
[一句]    [代码]    [行高]    [适应]    [一句代码实现cell行高自适应]   

项目介绍:

FSAutoAdjust-cellHeightDemo

cell行高自适应,论文,一句代码搞定需求,丝滑般顺畅的滚动体验

API

支持两种缓存方式

/** cell自动计算行高 @param tableView tableView @param indexPath indexPath @param contentViewWidth cell内容宽度,不确定可传0 @return cell高度 */ + (CGFloat)FSCellHeightForTableView:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath cellContentViewWidth:(CGFloat)contentViewWidth bottomOffset:(CGFloat)bottomOffset;/** cell自动计算行高优化版 @param tableView tableView @param indexPath indexPath @param cacheKey 当前cell唯一标识符 @param contentViewWidth cell内容宽度,开题报告,不确定可传0 @return cell高度 */ + (CGFloat)FSCellHeightForTableView:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath cacheKey:(NSString *)cacheKey cellContentViewWidth:(CGFloat)contentViewWidth bottomOffset:(CGFloat)bottomOffset;How To Use

1、将demo中的FSAutoAdjust-cellHeightLib拖入项目中导入#import 'UITableViewCell+FSAutoCountHeight.h';

2、cocoapods:pod search FSAutoAdjust-cellHeight 如果找不到执行pod setup 后 pod 'FSAutoAdjust-cellHeight'

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { FSEntity *entity = _datas[indexPath.row]; CGFloat height = [self.title isEqualToString:@'keyCache']?[FSTestTableViewCell FSCellHeightForTableView:tableView indexPath:indexPath cacheKey:entity.identifier cellContentViewWidth:0 bottomOffset:0]:[FSTestTableViewCell FSCellHeightForTableView:tableView indexPath:indexPath cellContentViewWidth:0 bottomOffset:0]; return height; }

详细请下载demo查看

Document

文档正在努力编写中。。。

文章地址:

Version

1.0.2 ——>添加cocoapods支持 2017.8.7


这里还有:


还可以点击去查询:
[一句]    [代码]    [行高]    [适应]    [一句代码实现cell行高自适应]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/5589.docx
  • 上一篇:DAONaviBar
  • 下一篇:高仿OFO共享单毕业设计车(SWIFT版)