微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐