对于viewForHeaderInSection中的自定义单元格,重新加载特定的viewForHeaderInSection IOS [英] For custom cell in viewForHeaderInSection reload particular viewForHeaderInSection IOS

查看:211
本文介绍了对于viewForHeaderInSection中的自定义单元格,重新加载特定的viewForHeaderInSection IOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在viewForHeaderInSection中重新加载viewForHeaderInSection以重新加载特定的viewForHeaderInSection IOS。

I want to reload viewForHeaderInSection in case of custom cell in viewForHeaderInSection to reload particular viewForHeaderInSection IOS.

我使用了以下代码

[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation: UITableViewRowAnimationAutomatic];

但整个部分将重新加载

我也尝试了以下内容通过创建自定义视图

SearchHeaderView是自定义视图

  - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{

            lblPrice_Header.text = [NSString stringWithFormat:@"%d",cartSum] ;
            return SearchHeaderView;

        }

 -(void)cartSum :(id)sender{
   .....
   .......
    =======================================
     cartSum =cartSum+[[subArray objectAtIndex:j]  intValue]*price;

        UIView *headerVw = [self.tableView headerViewForSection:section];
        [headerVw setNeedsDisplay];
        [headerVw setNeedsLayout];

    }

但它不会重新加载该部分。

But It wont reload the section.

我的章节标题如下所示

我检查了以下链接

在ios7中重新加载tableView标题

更改UITableView的节页眉/页脚标题而不重新加载整个表格视图

推荐答案

你可以尝试这样的事情:

You can try something like this:

UIView *headerVw = [YOURTABLEVIEW headerViewForSection:section];
[headerVw setNeedsDisplay];
[headerVw setNeedsLayout];

注意:


  • 要处理特定视图,您可以定义标签以及

希望它能为您服务。

这篇关于对于viewForHeaderInSection中的自定义单元格,重新加载特定的viewForHeaderInSection IOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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