为了账号安全,请及时绑定邮箱和手机立即绑定

如何隐藏不包含数据的section?

如何隐藏不包含数据的section?

PHP C
互换的青春 2019-04-10 11:07:05
如何隐藏不包含数据的section
查看完整描述

3 回答

?
芜湖不芜

TA贡献1796条经验 获得超7个赞

我现在的做法是

在-
(CGFloat)tableView:(UITableView *)tableView
heightForHeaderInSection:(NSInteger)section中返回0,

在-
(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell
forRowAtIndexPath:(NSIndexPath *)indexPath 中
[cell
removeFromSuperview]

查看完整回答
反对 回复 2019-04-13
?
慕妹3146593

TA贡献1820条经验 获得超9个赞

解决了,先把tableView.sectionHeaderHeight = 0;tableView.sectionFooterHeight = 0;再根据需要实现:- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section就可以控制group模式隐藏section了。

查看完整回答
反对 回复 2019-04-13
?
慕少森

TA贡献2019条经验 获得超9个赞

UITableview中隐藏静态section的方法

_paymentCell.hidden = YES; self.tableView.contentInset = UIEdgeInsetsMake(-90, 0, 0, 0);

查看完整回答
反对 回复 2019-04-13
  • 3 回答
  • 0 关注
  • 905 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信