【发布时间】:2014-01-30 07:25:41
【问题描述】:
我有一个包含 UITableView 的视图。在视图确实加载时,我将表的 tableFooterView 设置为我手动创建的视图(包含按钮的 UIView)。当视图出现时,我调整 tableFooterView 的框架:
CGRect tableFrame = self.myTableView.frame;
CGRect originalFrame = self.tableFooter.frame;
CGSize imageSize = CGSizeMake(40.0f, 40.0f);
CGRect footerFrame = CGRectMake(originalFrame.origin.x, originalFrame.origin.y, tableFrame.size.width, imageSize.height);
self.tableFooter.frame = footerFrame;
CGRect nextFrame = CGRectMake((footerFrame.size.width - imageSize.width) / 2.0f, 0.0f, imageSize.width, imageSize.height);
self.tableFooterButton.frame = nextFrame;
在 iOS7 上,这是我想要的方式——当我滚动到表格底部时,我会看到我的页脚视图。在 iOS6 上,当我滚动到表格底部时,页脚视图仍然在屏幕外(我可以拉动滚动视图并看到它,但当我释放时它会重置屏幕外)。
我应该做些什么不同的事情?
【问题讨论】:
-
在更改表格页脚的框架后试一试。
self.myTableView.tableFooterView = nil; self.myTableView.tableFootView = self.tableFooter. -
@KudoCC 这行得通。谢谢!愿意将其添加为答案吗?
标签: ios cocoa-touch uitableview