2011-01-14 48 views
0

我将访问分组的uitableview的特定部分,以在横向模式下更改其页脚高度。如何访问分组tableview中的某个特定部分?

如果我使用

self.tableView.sectionFooterHeight = 75.0; 

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

所有部分的页脚高度改变,但我只想要一个变化在第一部分的页脚高度

回答

1

你必须这样做,在

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

当你旋转上的tableView并在heightForFooterInSection测试的特定部分,为UIDeviceOrientation

好运

做一个reloadData编辑:

您得到设备方向

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; 
+0

太棒了!我用 - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)部分,但我忘了reloadData。结果还不完美,但至少我知道它没有奏效。 – Sefran2 2011-01-14 10:42:44

0

你必须实施

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

并将所有页脚高度的数组保持为实例变量。