【发布时间】:2015-01-08 18:19:07
【问题描述】:
我的Table View 中有更多内容,但是这个单元格被截断了,没有显示更多内容:
...所以我不能再滚动了,即使有更多的内容。
如果我用手指向上拉,它会显示更多内容,但是当我将手指从单元格上移开时,它会回到上图中显示的状态。
我已尝试确保在 AutoLayout 中设置 Labels 和 Images 的高度和宽度,因为我认为这可能是个问题,但仍未解决。
有什么想法吗?谢谢!
更新 - Storyboard 中的表格视图结构
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
id model = self.model[indexPath.row];
if ([model isKindOfClass:[DBase self]]) {
return 520;
}
else {
return tableView.rowHeight; // return the default height
}
}
【问题讨论】:
-
尝试设置 contentInset 这样的答案stackoverflow.com/questions/19634467/…
-
@Shan 感谢您的回复!我把 `self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);` 在我的
cellForRowAtIndexPath中并没有帮助,我应该把它放在其他地方吗? -
不,你不能将所有值都设为零,因为我的回答是根据你的单元格高度将底部值设为 100 或更高,例如将其放入 viewDidLoad `table.contentInset = UIEdgeInsetsMake (0, 0, 200, 0);`
标签: ios uitableview autolayout