简体   繁体   English

UICollectionView 重新排序:交互式移动还是拖放?

[英]UICollectionView reordering: interactive movement or drag and drop?

As of iOS 9, UICollectionView supports interactive movement via beginInteractiveMovement and its sibling methods.从 iOS 9 开始, UICollectionView 通过beginInteractiveMovement及其兄弟方法支持交互式移动。 As of iOS 11, it also supports drag and drop , which seems to support movement as well.从 iOS 11 开始,它还支持拖放,这似乎也支持移动 In iOS 13 beta 4, drag and drop gestures have been combined with UIContextMenuInteraction animations ( Twitter link ) so you can transition from a context menu to a drag operation, but the same isn't true when reordering via the interactive movement APIs.在 iOS 13 beta 4 中,拖放手势已与UIContextMenuInteraction动画( Twitter 链接)相结合,因此您可以从上下文菜单转换为拖动操作,但通过交互式移动 API 重新排序时情况并非如此。

Is it better to implement interactive movement of items in a collection view using drag and drop going forward?使用拖放前进在集合视图中实现项目的交互式移动是否更好?

It is better to migrate to UICollectionViewDragDelegate and UICollectionViewDropDelegate .最好迁移到UICollectionViewDragDelegateUICollectionViewDropDelegate I recently had a task where I had to combine context menu, reordering (after activation via context menu) and UICollectionViewCompositionalLayout with orthogonal sections.我最近有一项任务,我必须将上下文菜单、重新排序(通过上下文菜单激活后)和UICollectionViewCompositionalLayout与正交部分结合起来。 I have to say, that if you use gesture recognizers and interactive movement, it will break scrolling in all orthogonal sections.我不得不说,如果你使用手势识别器和交互式移动,它会在所有正交部分中断滚动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM