2016-11-15 118 views
-1

我加載從筆尖(廈門國際銀行)細胞tableviewcell如何使3行全景如何UITableViewCell佔據整個屏幕?

//tabelview cell register 

let nib: UINib = UINib(nibName: "ItemTableViewCell", bundle: nil) 

tableViewItemList.register(nib, forCellReuseIdentifier: "ItemTableViewCell") 

我已經花了很長的時間來解決這個問題,但我找不到任何解決辦法。

我需要顯示3行tableView,這三行必須佔用我的屏幕。目前,它顯示了三行,但還有一些額外的空白空間,我想要佔據這些行。

1

以上是我所得到的屏幕。下面是我想要實現的設計。下面的UITableViewDelegate的功能

2

+0

請放多一點精力投入到你的問題。很難理解你的目標和你的問題。 – jjs

+0

感謝更新 –

+0

您將不得不在運行時找出表視圖的大小(邊界)(因爲它對於不同大小的設備會有所不同),然後您必須相應地設置表視圖單元格的高度。 – Gruntcakes

回答

0

用途:

func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { 
    return tableView.frame.height/3 
} 

func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { 
    return tableView.frame.height/3 
} 
+0

當我添加導航第三數字行出屏幕。一點點 。你能幫我嗎?我該怎麼辦? –