Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

franium

macrumors member
Original poster
Nov 18, 2010
34
0
Hi everyone,

I have a grouped UITableView with some sections (with an header title). I want to add a footer to the first section, so I use
Code:
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section {

   switch (section) {
    case 0:
        return @"some lines of text...........bla bla bla bla bla etc etc");
        break;
    default:
        return nil;
        break;
    }
}

My problem is with the landscape mode. There is a quite big space between the footer and the header of the next section, so I change the footer height programatically in this way:

Code:
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
	switch (section) {
		case 0:
			if (UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
				return 85.0;
			} else {
				return 75.0;
			}
			break;
		default:
			return 10;
			break;
	}
}

But how can I change the footer height in
Code:
(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration
Any suggestions?
Thanks in advance,
Fran
 
Last edited:

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Several UITableView methods cause it to reload sections. reloadData, reloadSections:withRowAnimation: and probably beginUpdates/endUpdates. Call one of these when the device rotates.
 

franium

macrumors member
Original poster
Nov 18, 2010
34
0
Several UITableView methods cause it to reload sections. reloadData, reloadSections:withRowAnimation: and probably beginUpdates/endUpdates. Call one of these when the device rotates.

Thanks! I resolved using reloadData :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.