【问题标题】:How can I access one particular section of a grouped tableview?如何访问分组表视图的一个特定部分?
【发布时间】:2011-06-09 01:39:11
【问题描述】:

我将访问分组 uitableview 的特定部分,以在横向模式下更改其页脚高度。

如果我使用

self.tableView.sectionFooterHeight = 75.0;

-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration

所有部分的页脚高度都已更改,但我只想更改第一部分的页脚高度

【问题讨论】:

    标签: iphone uitableview height landscape footer


    【解决方案1】:

    你必须执行

    - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
    

    并维护一个包含所有页脚高度的数组作为实例变量。

    【讨论】:

      【解决方案2】:

      你必须这样做

      - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
      

      当您进行旋转时,在 tableView 和 heightForFooterInSection 测试特定部分和 UIDeviceOrientation 上执行 reloadData

      祝你好运

      编辑:

      你得到设备方向

      UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
      

      【讨论】:

      • 太棒了!我使用了 -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section,但我忘记了 reloadData。结果还不完美,但至少我弄清楚了它不起作用的地方。
      猜你喜欢
      • 2011-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-19
      • 2014-06-04
      • 2013-12-20
      相关资源
      最近更新 更多