2016-10-27 40 views
0

只有那些顯示適合屏幕的單元。如果滾動到下一個(屏幕外)單元格,則只顯示白色屏幕。它允許滾動,但只顯示空格。即使是一半顯示的最後一行也只剩下一半。UITableView單元問題 - 滾動時不顯示關閉屏幕單元

extension LiveTVController: UITableViewDataSource,UITableViewDelegate { 


func numberOfSections(in tableView: UITableView) -> Int { 
    return 10 
} 

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 
    return 1 
} 

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 
    let reuseIdentifier = tableView.tag == 1 ? ProgrammeListCell.reuseIdentifier : StreamListCell.reuseIdentifier 
    let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier, for: indexPath) 

    if let cell = cell as? StreamListCell { 
     cell.programmeList.delegate = self 
     cell.programmeList.dataSource = self 
    } 

    return cell 
} 

func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { 
    return tableView.tag == 2 ? 10 : 0 
} 

On Screen launch

現在向下滾動下一行之後。共有10個部分返回,每個部分有1行。

After scrolling to down

+0

表視圖是否存在於滾動視圖中?單元格內是否存在滾動視圖?視圖中有手勢識別器嗎?看看你的用戶界面,似乎你有左/右滑動瀏覽屏幕,請確認。 – Windindi

+0

@ Windindi我在桌面視圖中的主視圖和集合視圖上有tableView。 –

+0

爲什麼你的tableView 10節?每節只有1條記錄? – wieseman

回答

0

根據小區type.And也放置在一個表視圖頭,而不是使用小區第一元件這視頻觀看指定單元格的高度。

+0

視頻視圖在表視圖之外,將嘗試指定高度。它對所有行都是固定的。 –

+0

是否修復? –

+0

是的,它是固定的 –

相關問題