forkingdog / forkingdog/UITableView-FDTemplateLayoutCell

高度计算有时候不正确

Open
#229 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
9.9k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

约束规则如下:

![13 pic](https://cloud.githubusercontent.com/assets/11417802/17507694/ad5df4d0-5e43-11e6-8956-e6613b992012.jpg)

通过如下方法返回cell的高度:

```
CGFloat height = [tableView fd_heightForCellWithIdentifier:detailCell configuration:^(CHDetailCell *cell) {
cell.titleLabel.text = @"公司名称";
cell.subTitleLabel.text = self.shopOwner.companyName;
}];
return height >= 44 ? height : 44;
```

问题来了,有时候计算出来的cell的高度不正确,subTitleLabel字段会被截断,如下:

companyName:@“深圳市腾讯计算机系统有限公司”,计算高度不正确

![47 pic](https://cloud.githubusercontent.com/assets/11417802/17508025/701d3d90-5e45-11e6-9b82-505a0d7d6868.jpg)
companyName:@“深圳市腾讯计算机系统有限公司有限公司有限公司”,cell高度正常:

![48 pic](https://cloud.githubusercontent.com/assets/11417802/17508080/bee8410e-5e45-11e6-87ee-79b255898f01.jpg)
不知道哪里出了问题!!!不清楚是否和cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;导致右侧缩进有关,试过去掉箭头,但是还是不能正确计算高度。

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.