2015-12-14 105 views
0

我有一個具有靜態單元的uitableviewcontroller,它們是4個單元格。如何使屏幕底部的uitableviewcontroller

所以結果是這樣的: enter image description here

當你看到有在按鈕白色的空間,我想改變它的顏色,我改變看法的隨附的UITableViewController顏色,但這沒有幫助。我讀我明白,我必須作出表視圖scrol屏幕的BUTTOM,

我想這代碼(我互聯網上找到)

if tableView.contentSize.height > tableView.frame.size.height 
     { 
      let offset = CGPoint(x: 0, y: tableView.contentSize.height - tableView.frame.size.height) 
      tableView.setContentOffset(offset, animated: false) 
     } 

,但什麼都沒有改變,我要問你如果你知道一個解決方案,請

回答

1
  • 此行。 tableView

    2:前往檢查,並改變你的背景顏色在 「查看」

change BackgroundColor

3.-運行

enter image description here

0

有不同的方法來實現它:

  1. 設置單元格的高度等於屏幕高度/ 4
  2. UITableView添加一個約束到UITableView的容器 的底部,並將其值設置爲0(從故事板)
1

只要改變你的tableView的背景顏色只需添加這tableView.backgroundColor = UIColor.blueColor()中的tableView應該在在我看來,視圖的頂部,所以我會建議改變背景顏色。

如果你用故事板

1.-選擇您的tableView添加在您的viewDidLoad()