2016-12-16 53 views
2

我在我的項目中整合了一個tableview。我面臨的問題就像我自動滾動我的桌面視圖和我的UITableViewCell內容縮放一樣。雖然我沒有對UITableViewCell內容進行任何操作,但我只是在桌面視圖之上設置了UIView的動畫。爲什麼UITableview單元格內容在滾動時縮放?

這是我的源代碼的片段。

func scrollViewDidScroll(scrollView: UIScrollView) 
{ 

let scrollViewHeight = Float(scrollView.frame.size.height) 
let scrollContentSizeHeight = Float(scrollView.contentSize.height) 
let scrollOffset = Float(scrollView.contentOffset.y) 

    print(scrollOffset) 
      if (scrollOffset == 0) 
      { 
       self.horizontalSpacing.constant = 8 

       UIView.animateWithDuration(0.5) 
       { 
        self.view.layoutIfNeeded() 
       } 
      } 
      else if (scrollOffset + scrollViewHeight <= scrollContentSizeHeight) 
      { 
       self.horizontalSpacing.constant = -75 

       UIView.animateWithDuration(1.0) 
       { 
        self.view.layoutIfNeeded() 
       } 
      } 
     } 

如果我想停止縮放UITableViewCell內容,我會做什麼?

回答

1

迅速2.2:在我的情況: 檢查FUNC的tableView(的tableView:UITableView的,heightForRowAtIndexPath indexPath:NSIndexPath) - > CGFloat的{} 改變任何線self.view.frame.size.height到UISceeen.main.bounds。高度。

相關問題