2016-03-07 83 views
0

我有一個非常難過的時間試圖讓我的scrollView正確顯示內容。UIScrollView截斷底部內容

對於一個頁面,似乎顯示出對底部的空白內容的堆和另外它到達底部...傷心至極之前切斷。我已經將scrollView的約束條件設置爲0。

Xcode screenshot

Screenshot of all the space

我一直在玩弄試圖設置contentSize但是這似乎並沒有做任何事情。

@IBOutlet weak var scrollView: UIScrollView! 

override func viewDidLoad() { 
    super.viewDidLoad() 

    self.automaticallyAdjustsScrollViewInsets = false 



    self.scrollView.contentSize = CGSizeMake(self.view.bounds.size.width, self.view.bounds.size.height) 

    print("Width: \(self.view.bounds.size.width) Height: \(self.view.bounds.size.height) scrollView: \(self.scrollView.contentSize)") 

    // prints -> Width: 375.0 Height: 667.0 scrollView: (375.0, 667.0) 


} 

回答

0

很難說只有屏幕截圖可能是什麼,但我有一些建議。選擇ScrollView,然後選擇:

  • 檢查指標插入是否全爲零。
  • 水平安排選擇填充容器並垂直填充容器。
  • 嘗試更改高度的高度值以檢查它是否設置得比所需要的大。

下面一個什麼樣的截圖,你應該看到

ScrollView ruler section