iphone - 重新排序控件未显示在 TableView 中

标签 iphone cocoa-touch ios uitableview core-data

我基于基于导航的应用程序模板创建了一个 iOS 应用程序,该应用程序由 Core Data 框架支持。

单击“编辑”按钮时,我希望这些行可以重新排序和删除。

构建单元格时,我添加了这一行:

cell.showsReorderControl = YES;

tableView:canMoveRowAtIndexPath: 方法返回 YES。

但是行中没有显示重新排序控件,我是不是漏掉了什么?

最佳答案

来自UITableViewCell showsReorderControl docs :

For the reordering control to appear, you must not only set this property but implement the UITableViewDataSource method tableView:moveRowAtIndexPath:toIndexPath:. In addition, if the data source implements tableView:canMoveRowAtIndexPath: to return NO, the reordering control does not appear in that designated row.

关于iphone - 重新排序控件未显示在 TableView 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4769418/

相关文章:

objective-c - 自定义 NSURLProtocol 应该遵循重定向本身,还是让其客户担心?

ios - 仅横向 View 在模拟器旋转之前不会自动调整大小

iphone - 在 iPhone 上重新创建日历 "Day" View ?

objective-c - 使用 NSFetchedresultsController 对 'transient' 字段进行排序

ios - 在传递多个 UIView 时注册触摸

iphone - UITableView 组样式上的黑角

ios - 使用 ad hoc 生成的 native ipa 文件无法在 ios 13 真实设备上运行

iphone - 在 iphone 应用程序的 InApp 购买中检索产品列表时出现问题

iphone - Facebook 共享窗口问题

iphone - 在 iPad 上运行的 iPhone 应用程序中横向 View 顶部有 20 像素间隙