就像在苹果商店一样,我希望在我的 tableview 中添加一个“更多”部分。
我已经搜索过,但我不确定如何解释我在寻找什么。任何人都可以帮助我如何继续实施这个吗?
我想为单行提供一个可扩展的表格视图。
就像在苹果商店一样,我希望在我的 tableview 中添加一个“更多”部分。
我已经搜索过,但我不确定如何解释我在寻找什么。任何人都可以帮助我如何继续实施这个吗?
我想为单行提供一个可扩展的表格视图。
您可以在表格视图的页脚视图中添加更多按钮。因此,它将显示用户何时滚动到底部。
- (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(@"More",@"") 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;
}
tableview.tableFooterView = [self createViewForTableFooter];
希望对你有帮助:)