0

就像在苹果商店一样,我希望在我的 tableview 中添加一个“更多”部分。

在此处输入图像描述

我已经搜索过,但我不确定如何解释我在寻找什么。任何人都可以帮助我如何继续实施这个吗?

我想为单行提供一个可扩展的表格视图。

4

2 回答 2

0

您可以在表格视图的页脚视图中添加更多按钮。因此,它将显示用户何时滚动到底部。

- (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];
于 2013-06-04T11:51:30.023 回答
0

检查链接:- https://iphonedevsdk.com/forum/iphone-sdk-development/99011-uitableview-cell-size-increases-on-tap-of-uibutton-inside-it.html

希望对你有帮助:)

于 2013-06-04T11:54:35.423 回答