UITableView:viewForHeaderInSection:在reloadData期间未调用: [英] UITableView : viewForHeaderInSection: not called during reloadData:

查看:1099
本文介绍了UITableView:viewForHeaderInSection:在reloadData期间未调用:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用正确的委托和数据源链接设置了tableview .. reloadData方法调用了数据源和委托方法,但 viewForHeaderInSection:除外。

I've set up the tableview with correct delegate and datasource linkages.. the reloadData method calls the datasource and the delegate methods except for viewForHeaderInSection:.

为什么会这样?

推荐答案

使用 tableView:viewForHeaderInSection:要求你也实施的tableView:heightForHeaderInSection:。这应该为标题返回适当的非零高度。另外,请确保您没有实现 tableView:titleForHeaderInSection:。你应该只使用一个或另一个( viewForHeader titleForHeader )。

The use of tableView:viewForHeaderInSection: requires that you also implement tableView:heightForHeaderInSection:. This should return an appropriate non-zero height for the header. Also make sure you do not also implement the tableView:titleForHeaderInSection:. You should only use one or the other (viewForHeader or titleForHeader).

这篇关于UITableView:viewForHeaderInSection:在reloadData期间未调用:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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