ios – showsReorderControl有什么意义?

我有一个UITableView实例并实现:
tableView:canEditRowAtIndexPath:
tableView:editingStyleForRowAtIndexPath:
tableView:shouldindentWhileEditingRowAtIndexPath:
tableView:canMoveRowAtIndexPath:
tableView:moveRowAtIndexPath:toIndexPath:

之后,我可以通过重新排序控件查看所有细胞.

Apple的标题说:

@property(nonatomic) BOOL showsReorderControl; // default is NO

如果认值为NO,为什么我看到重新排序控件?

更新:
我还在tableView:cellForRowAtIndexPath中检查了属性的值:在创建单元格之后:

(lldb) p [c showsReorderControl]
(BOOL) $1 = NO

解决方法

当您从tableView:canMoveRowAtIndexPath:返回YES时,它与将showsReorderControl设置为YES完全相同.这些只是启用重新排序控制的两种不同方法.

事实上,还有第三种方式 – 让我们永远不要抱怨我们没有选择权! ;)从tableView的文档:canMoveRowAtIndexPath ::

This method allows the delegate to specify that the reordering control for a the specified row not be shown. By default,the reordering control is shown if the data source implements the tableView:moveRowAtIndexPath:toIndexPath: method.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...