Search code examples
iphoneuitableviewheightlandscapefooter

How can I access one particular section of a grouped tableview?


I would access a particular section of a grouped uitableview for changing its footer height in landscape mode.

If I use

self.tableView.sectionFooterHeight = 75.0;

in

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

the footer height of all sections is changed, but I want a changing only in the first sections's footer height


Solution

  • You must do that in

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

    When you do the rotation do an reloadData on the tableView and in the heightForFooterInSection test for the particular section and for the UIDeviceOrientation

    Good luck

    Edit:

    You get the device orientation

    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];