0
A
回答
0
好的,我們解決了這個問題。
的問題是在這個代碼:
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if indexPath.row > 22 && !isAll && indexPath.row == signArray.count-1{
//This makes the table load inspections in chunks of 24 meaning alot of smaller DB calls instead of one big one and therefore a better user experience since it reduces load times.
signArray = signArray + appDelegate.dbInterface.findInspectionsBySeriesID(signArray[0].seriesID, offset: numberOfLoads*24, limit: 24)
numberOfLoads++
tableView.reloadData()
}
}
的這裏的邏輯是有點瑕疵的,也不管是否有新的數據或不表得到了重新加載。離開上表單元格空白,它仍然是奇怪的,當沒有數據得到,它只會發生,但將其更改爲:
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if indexPath.row > 22 && !isAll && indexPath.row == signArray.count-1{
//This makes the table load inspections in chunks of 24 meaning alot of smaller DB calls instead of one big one and therefore a better user experience since it reduces load times.
var newInspections = appDelegate.dbInterface.findInspectionsBySeriesID(signArray[0].seriesID, offset: numberOfLoads*24, limit: 24)
if !newInspections.isEmpty{
signArray = signArray + newInspections
numberOfLoads++
tableView.reloadData()
}
}
}
解決了這一問題。
+0
嗨,我有同樣的問題,當我向上滾動並保持幾秒鐘,然後單元格消失,釋放後滾動單元格會自動出現,但我仍然沒有找到確切的情況。 –
相關問題
- 1. Swift - 滾動備份時TableView崩潰
- 2. Swift UICollectionViewCell當滾動時隨機空白的動畫視圖
- 3. 當滾動tableview時,單元格變成空白(swift)
- 4. iPad Swift Playgrounds股份空白.playgrounds文件
- 5. 用定時器滾動備份
- 6. 滾動時UITableView單元格變空白
- 7. 滾動時的空白工具欄
- 8. 移動設備滾動得太遠(進入空白區域)
- 9. 水平滾動 - 白色空白問題
- 10. 在swift中 - UITableview滾動時滾動
- 11. Swift - 滾動時tableViewCell問題
- 12. 如何使用uiscrollview滾動備份?
- 13. Bootstrap Affix底部不滾動備份
- 14. UIScrollView顯示空白,滾動觸摸
- 15. IE滾動條中的額外空白
- 16. 滾動頁邊空白處的更改
- 17. 在Xcode模擬器上啓動時屏幕爲空白[swift 3.0]
- 18. Pervasive表的自動備份
- 19. 滾動視圖不滾動,並在底部創建空白
- 20. 如何在滾動備份時重置scrollTop()div定位?
- 21. 滾動到底部並備份後,出現在頁面底部的空白(手機)
- 22. 隱藏滾動條上的動作欄留下空白空間
- 23. WebDeploy回滾部分備份
- 24. InstallShield回滾備份目錄?
- 25. 通過單擊滾動條上的空白空間來禁用滾動功能
- 26. 工具欄變爲空白,同時滾動
- 27. UIWebView在滾動到頂部時顯示空白
- 28. MPMoviePlayerController在UICollectionViewCell中滾動時變爲空白
- 29. UICollectionView在滾動時留下空白單元格
- 30. 當再次滾動tableview時,單元格顯示爲空白?
請勿使用屏幕截圖。只需複製並粘貼代碼即可。 – Fogmeister
只是一個建議。在第3行中,你將'tableCell'定義爲'UITableViewCell!''因爲在接下來的幾行中你將填充'tableCell'變量,所以你可以聲明它爲'UITableViewCell'而不用'!'。 Infact Swift會檢查你是否總是在使用它之前填充var,並且允許它。 –
另一個建議,如果可能的話,你應該使用'let'而不是'var'。因爲一旦分配'tableCell'不會改變,你應該使用'let'聲明它爲常量。 –