TableView 不调用 GetHeightForRow [英] TableView does not call GetHeightForRow
问题描述
我有一个继承自 UITableViewSource
并覆盖 GetHeightForRow 的类:
I have a class which inherits from UITableViewSource
and overrides GetHeightForRow:
public override float GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
但是,在某个时间点操作系统停止调用此方法,因此我的所有单元格现在都具有相同的高度.表和表源的其余部分工作正常.这很奇怪,我尝试了各种方法,但它只是不调用方法.表源的其他覆盖方法正常调用.
However, at some point in time the OS stopped calling this method, so all my cells have the same height now. The rest of the table and table source is working fine. This is very strange, and I have tried all sorts of things, but it just does not call the method. The other overridden methods of the table source are called normally.
是否有某种设置使 UITableView
停止调用 GetHeightForRow
?
Is there some sort of a setting which makes the UITableView
stop calling GetHeightForRow
?
推荐答案
您能否同时设置 UITableViewDelegate
类型的 Delegate
(或 WeakDelegate
)code> 和 Source
(UITableViewSource
类型)属性?
Could you be setting both a Delegate
(or WeakDelegate
) of type UITableViewDelegate
and the Source
(of type UITableViewSource
) property ?
它们都暴露了 GetHeightForRow
,如果两者都用在同一个 UITableView
上,它们就会发生冲突.
They both expose GetHeightForRow
and they will conflict if both are used on the same UITableView
.
这篇关于TableView 不调用 GetHeightForRow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!