ios - 如何删除我不在 Swift 中使用的空单元格

标签 ios swift uitableview

我有一个 toEat 数组:

var toEat = ["苹果"]

此外,用户可以在运行应用程序时向数组中添加更多水果,例如:

var toEat = ["苹果", "香蕉"]

数组中除了苹果和香蕉外什么都没有,那么为什么当我运行应用程序时我得到的是空单元格?我怎样才能删除它?

enter image description here

最佳答案

你可以试试这行代码:

self.tableView.tableFooterView = UIView(frame: CGRectZero)

关于ios - 如何删除我不在 Swift 中使用的空单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32678339/

相关文章:

iphone - 特定国家/地区限制 Appstore

iphone - 为什么不使用 self 。类内调用

swift - 图表的 Horizo​​ntalBarChart 的左轴从顶部剪裁

IOS - UITableViewCell 重叠 UITableViewCell

iphone - 自定义 UITableViewCell 中的 UITextView 不响应 didSelectRowAtIndexPath

android - 适用于 iOS 和 Android 的 Xamarin Forms Syncfusion sfChart 自定义标签

ios - [NSObject : AnyObject] ?' does not have a member named ' subscript' in Xcode 6 Beta 6

Swift 通用约束无法转换值

ios - Metal 入门

swift - 什么时候调用 CellForRowAt? -- 排队直到 VC 排在最前面?