我有一個滾動視圖,其中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