2015-11-05 30 views

回答

1

請您可以嘗試使用此: -

if (self.tableView.contentOffset.y >= (self.tableView.contentSize.height - self.tableView.bounds.size.height)) 
{ 
    // Don't animate 
} 

OR ----

在今天的時代(Xcode中7),下面的代碼要解決大多數使用情況,因爲它佔的UIScrollView(和它的子類的UITableView和UICollectionView)插圖,故事板單爲多臺設備(即大小班) -

func scrollViewDidScroll(scrollView: UIScrollView) { 
    if (Int(scrollView.contentOffset.y + scrollView.frame.size.height) == Int(scrollView.contentSize.height + scrollView.contentInset.bottom)) { 
     if !isFetching { 
      isFetching = true 
      fetchAndReloadData(true) 
     } 
    } 
} 

選中這兩個辦法,我認爲這是對你有幫助。 :-)

相關問題