gpt4 book ai didi

ios - 当用户滑动并点击手指(使用触摸手势)时,如何隐藏所有 CollectionViewCell?

转载 作者:行者123 更新时间:2023-11-29 00:03:26 26 4
gpt4 key购买 nike

我正在 iOS 中开发屏幕测试应用程序,我想在用户滑动并点击手指时隐藏所有 CollectionViewCell。我使用了 touchesBegan、touchesMoved、touchesEnded 方法,但没有奏效。也对其他逻辑开放。

下面是 CollectionView 的截图。

This

最佳答案

func respondToSwipeGesture(gesture: UIGestureRecognizer) {
let point: CGPoint = gesture.location(in: collectionBlocks)
if let theIndexPath: IndexPath = collectionBlocks.indexPathForItem(at: point)
{
let selectedCell = collectionBlocks.cellForItem(at: theIndexPath)
selectedCell?.backgroundColor = UIColor.clear
}
}

关于ios - 当用户滑动并点击手指(使用触摸手势)时,如何隐藏所有 CollectionViewCell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48759825/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com