您的位置:首页 > 产品设计 > UI/UE

iOS -UITableView-FDTemplateLayoutCell 的使用

2016-04-26 19:06 519 查看
基本应用

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: "-tableView:cellForRowAtIndexPath:"中的一些赋值操作,为了提前获取行高
// cell.entity = self.feedEntities[indexPath.row];
}];


下面是我对UITableView+FDTemplateLayoutCell在项目中的运用效果:




当时要做这个界面的自适应的时候也是费了一些劲,但是用了UITableView+FDTemplateLayoutCell再配合 UIView-FDCollapsibleConstraints一起使用,一些就变得简单了。

UITableView+FDTemplateLayoutCell的github地址:

UIView-FDCollapsibleConstraints的github地址:

详细用法在github上面。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息