为什么最后一个单元格的UITableView高度用于剩余的空单元格? [英] Why does last cell's height of UITableView get used for remaining empty cells?

查看:49
本文介绍了为什么最后一个单元格的UITableView高度用于剩余的空单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的所有单元格都有不同的高度,这取决于用户输入的文字.

My cells all have varying heights, determined by text entered by the user.

无论最后一个单元格的高度是多少,似乎都可以确定(更改)所有剩余空白单元格的高度.

Whatever height the last cell takes on seems to determine (change) the height for all remaining blank cells.

似乎没有为剩余的这些空单元格调用heightForRowAtIndexPath,CFRAIP也没有.

It doesn't appear that heightForRowAtIndexPath is getting called for these remaining, empty cells, nor is CFRAIP.

有人知道如何解决此问题或为什么会发生这种情况?

Does anyone know how to fix this or why it is happening?

推荐答案

将此代码放在放置Tableview的viewController的viewDidLoad中.

Put this code in viewDidLoad of the the viewController where Tableview is placed.

self.tableView.tableFooterView = [[UIView alloc] init];

这篇关于为什么最后一个单元格的UITableView高度用于剩余的空单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆