我有一个滚动视图,其中3 UITableViews
用于分页。所有的UITableViews
加载更多的数据单元格。第一个UITableView
比另外两个加载更多的单元格。首先查看第一个UITableView
我可以滚动到底部,但当我滚动到第二个UITableView
并返回到第一个UITableView
时,我无法再一直向下滚动。看起来好像我不得不调整我的滚动视图。为什么我不能在查看刷新后滚动到底部?任何帮助都会很棒。ios:UITableView不会滚动到底部
*第一个UITableView
在顶部有一个搜索栏。其他两个不。我试图删除搜索栏,但错误仍然发生。
//Create a frame for each page and add the page to the scroll view
- (void)frameToScrollView{
if (pages!=NULL) {
for (int i = 0; i < pages.count; i++) {
//Get the current view controller
UITableViewController *controller = [pages objectAtIndex:i];
//Create a frame for the current table view controller
CGRect frame = controller.view.frame;
frame.origin.x = self.scrollView.frame.size.width * i;
frame.origin.y = 0;
frame.size = self.scrollView.frame.size;
controller.view.frame = frame;
//Add the the current table view controller page to the scroll view
[self.scrollView addSubview:controller.view];
}
}
}
设置其他属性:
//Set the properties for the scroll view
- (void)setScrollViewProperties{
self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width * pages.count, self.scrollView.frame.size.height);
self.scrollView.contentOffset = CGPointMake(self.scrollView.frame.size.width, 0);
self.scrollView.scrollsToTop = NO;
}
你检查了吗? http://stackoverflow.com/questions/3422915/scrolling-a-uitableview-inside-a-uiscrollview – Peres 2013-04-11 08:24:43
@杰克男孩立即检查。没有,不是。我能够滚动到底部,但是当我加载另一个UITableView并回来时,我只能滚动一点点(可能是滚动视图的大小或其他UITableViews的大小)。 – wwjdm 2013-04-11 08:27:51