【发布时间】:2021-05-26 18:33:13
【问题描述】:
我的 ViewController 为我创建 contextMenu 的所有 UICollectionView 提供了三个 UICollectionView,但是对于最后一个 UICollectionView,我不想显示菜单,并且对于
如何禁用最后一个UICollectionView的长按动画?确实很简单,但我不能删除默认大小写。
我的代码示例:
func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
switch collectionView {
case favoriteCollectionView:
return UIContextMenuConfiguration(identifier: nil, previewProvider: nil) {...}
case allCollectionView:
return UIContextMenuConfiguration(identifier: nil, previewProvider: nil) {...}
default:
// This menu empty and doesn't show but the animation of long pressed not disabled how to fix this?
return UIContextMenuConfiguration(identifier: nil, previewProvider: nil)
}
}
【问题讨论】:
标签: swift animation uicollectionview long-press uicontextmenuconfiguration