ios - 提交 EditingStyle 删除按钮不会显示

标签 ios objective-c xcode uitableview swift

我有一个疯狂的问题。我想在我的应用程序中使用 Swift 在我的 UITableView 中实现“滑动删除”。

一些非常简单的事情,滑动工作正常,但从未显示我的红色删除按钮。

func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
    // If a row could not be edited we have to return false for the row index
    return true
}

func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
    
}

我已经在 3 个新项目上对此进行了测试,当我自己编写这些功能时,按钮从未显示,我不知道为什么!

我肯定已经下载了他的代码,他的代码工作正常,我有删除按钮。

我的 TableView 工作正常,没有错误,没有问题,调试器告诉我没有任何用处。我迷路了!这是 Xcode 的错误吗? 这里有一个屏幕 My issue 我想要什么: Yay

你们有什么想法吗?

最佳答案

对不起浪费时间的人,我遇到了和这里一样的问题:

Monotouch "Swipe To Delete" CommitEditingStyle Not Firing

我的表格 View 比屏幕范围大...所以我的按钮在这里,但我看不到它!

感谢您的帮助! 捂脸

关于ios - 提交 EditingStyle 删除按钮不会显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27024750/

相关文章:

iphone - UIKeyboardTypeDecimalPad 中的小数点不能用于数学计算

ios - 我在上传时不断收到错误 "This action could not be completed. Try again. (-22421)"

iphone - 使用storyboard在xcode 4.5中创建多级导航 Controller

ios - 将 UIImage 裁剪到中心正方形

ios - 点击自定义注释并执行相应的功能

ios - swift:表格 View 单元格中按钮上的弹出窗口始终显示在第一个单元格上

iOS8 - 在 UINavigationController 上推送 UIViewController 并旋转设备后,以前的 View Controller 中的大小错误

iphone - 如何在 iphone 中找到图像的颜色边缘?

ios - 如何在 Xcode6 的 Storyboard上重置特定大小的类数据?

ios - 使用 RestKit 0.25 将本地 XML 解析为 CoreData