【问题标题】:iOS UITableView: UIView/custom cell at the bottom like in twitter iPad appiOS UITableView:底部的 UIView/自定义单元格,就像在 twitter iPad 应用程序中一样
【发布时间】:2012-04-20 06:17:55
【问题描述】:

我正在使用 Xcode 4.3 中提供的主从模板创建一个 iPad 应用程序。我的主表视图充当详细视图的导航菜单,并且菜单项将被修复。所以我基本上不需要滚动视图,所以我把它关掉了。

self.tableView.scrollEnabled = NO;

现在我需要在主菜单底部显示一个页脚,如单元格对齐,就像在 Twitter iPad 应用程序中一样。单元格应以横向和纵向模式出现在底部。有人可以给我一些关于如何实现它的提示吗?

我在一些博客上阅读了有关使用 UIView 并将其设置为 UITableView.tableFooterView 的信息,类似这样...

// I'll have to do calculations of frame height/x/y for both orientations 
// to make the view appear at bottom - IS THERE A SIMPLER WAY???
UIView *footerView =  [[UIView alloc] initWithFrame:CGRectMake(0, 944, self.tableView.frame.size.width, 60)];

UILabel *logo = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 60)];
logo.text = @"This is the Footer.";
[footerView addSubview:logo];
self.tableView.tableFooterView = footerView;

【问题讨论】:

标签: uitableview ios5 table-footer


【解决方案1】:

查看应用程序后,我认为“页脚”不是表格的一部分。它看起来更像是桌子下的一个小视图。所以桌子被设置成它会垂直伸展,但它的高度被锁定在底部视图之上。也许最好为您的主视图使用UIViewControllerUIView 而不是UITableViewController。然后将您的UITableView 放入UIView 并将您的页脚放在它下面。然后像以前一样配置UIViewController 以使用UITableView

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-16
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多