2016-10-27 37 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

是的,它是固定的 –

相关问题