我基于基于导航的应用程序模板创建了一个 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/