使用此功能創建表頁腳視圖
- (UIView *) createViewForTableFooter
{
CGRect footerRect = CGRectMake(0, 0, self.view.frame.size.width, 60);
UIView *tableFooter = [[[UIView alloc] initWithFrame:footerRect] autorelease];
tableFooter.backgroundColor = [UIColor clearColor];
UIButton* verifyButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[verifyButton setTitle:WNLocalizedString(@"Verify",@"") forState:UIControlStateNormal];
[verifyButton.titleLabel setFont:[UIFont boldSystemFontOfSize:20]];
[verifyButton addTarget:self action:@selector(verifyBtnTapped:)forControlEvents:UIControlEventTouchUpInside];
verifyButton.autoresizingMask = UIViewAutoresizingFlexibleWidth;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[verifyButton setFrame:CGRectMake(44, 10, self.view.frame.size.width - 88, 37)];
}else {
[verifyButton setFrame:CGRectMake(10, 10, self.view.frame.size.width - 20, 37)];
}
[tableFooter addSubview:verifyButton];
return tableFooter;
}
並在您的viewDidLoad方法中使用此功能
yourTableObjectName.tableFooterView = [self createViewForTableFooter];
我做到了。我用sectionFooterHeight,現在頁腳完全不出現。 – 2012-04-07 11:36:05