如何删除TableViewController,iOS中的额外空单元格 - Swift [英] How to remove extra empty cells in TableViewController, iOS - Swift

查看:56
本文介绍了如何删除TableViewController,iOS中的额外空单元格 - Swift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有一个带有两个静态单元格的 TableViewController ,但是在显示时,它会显示两个静态单元格,然后显示tableview的所有其他空单元格。但是我不想显示这些细胞,因为它们没用。如何将剩余的单元格与两个静态单元格分开?

Hi I have a TableViewController with two static cells, however when displayed, it shows the two static cells, and then all the other empty cells for the tableview. However I don't want to display those cells as they are useless. How do I hide the rest of the cells apart from the two static cell?

推荐答案

viewDidLoad中() function添加以下代码行:

in your viewDidLoad() function add this line of code:

tableView.tableFooterView = UIView()

这篇关于如何删除TableViewController,iOS中的额外空单元格 - Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆