cellForRowAtIndexPath不调用

时间:2016-06-22 17:09:50

标签: objective-c uitableview

有趣的事情。如果我将某个单元格的高度设置为0:

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
 if (indexPath.row == 0) {
     return 0;
    } else {
return 10;
}

比 -

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
will not call for that index (for indexPath.row == 0).

只有在iPhone(IOS 9.3)上进行测试时才能看到此流程。 (在iPad这个方法cellForRowAtIndexPath会调用)!

你知道为什么我们有不同的流程吗?

0 个答案:

没有答案
相关问题