cost 401 ms
如何检测长按 UICollectionViewCell 并在单元格中执行操作 - How to detect long press on a UICollectionViewCell and and perform an action a the cell

我有一个显示在 UICollectionViewCell 中的图像列表。 现在我想要一种在用户长按单元格时在图像上显示叠加层的方法。 我已经能够在单元格上放置一个长按手势,但不幸的是如何在单元格上执行覆盖是我努力实现的地方。 在我的 cellForItemAt 我有这个 我有这个 function ...

如何限制 LongPressGesture-began 和 LongPressGesture-ended 之间的进程 - How to limit a process between LongPressGesture-began and LongPressGesture-ended

要求很简单:当用户触摸屏幕并按住手指时,我想启动一个活动(例如在屏幕上绘制圆圈)。 当手指再次抬起时,该活动将立即停止。 所以我使用了UILongPressGestureRecognizer 。 这会产生一个.began 和.ended 事件。 但是问题是当一个activity基于the.began ...

On long press, how do you call an ImagePreviewController: UIViewController from an objective c function instead of a contextMenuInteraction function? - On long press, how do you call an ImagePreviewController: UIViewController from an objective c function instead of a contextMenuInteraction function?

下面这个 function 需要将 go 改为 ObjC function 现在对象 C function ObjC 在覆盖 function 中获取句柄 我目前遇到什么错误: 非空中空 function。 也就是说,如果我将代码的 ringy/image3 和 green/image3 部分放 ...

如何检测“长按” - How to detect "long tap"

我有一个UIView视图,我想在用户按下然后释放时执行一些操作。 我在视图中添加了一个UITapGestureRecognizer ,它仅在点击持续时间很短时触发。 如果用户触摸视图,等待几秒钟然后抬起手指,则什么也不会发生。 如何检测“长按”事件? UILongPressGestureReco ...

如何在点击 LongPressGesture Objective-C 中重置/重启 NSTimer - How to reset/restart NSTimer in tap LongPressGesture Objective-C

我在长按手势中遇到 NSTimer 的小问题。 如何使任何新闻的计时器无效? 如果我长按了计时器,则从任何按下的单元格开始计时。 例如,我长按了 3 个单元格,定时器工作了 3 次。 我不知道。 下面是我的代码,我在一段时间后尝试给出一个条件,现在hideButtonTimer不算数。 我有 NS ...

UILongPressGestureRecognizer 位置 function 问题在 collectionView iOS 13.2 - UILongPressGestureRecognizer location function issue in collectionView iOS 13.2

当拖动项目原始 position 时,我使用 UILongPressGestureRecognizer 位置(在:UIView?)方法进行了有线闪烁。 单元格时有不自然的轻弹。 在 iOS 12 中一切正常。 这是来自 SumeetMourya 的演示项目演示分支的链接 ...

当 swift 中所需的触摸次数超过一个时,如何获取 UILongPressGestureRecognizer 的触摸位置? - How do you get the location of touches for a UILongPressGestureRecognizer when the number of required touches is more than one in swift?

我想从 UILongPressGuestureRecognizer 获取多个多次触摸的位置,其中所需的触摸次数不止一个。 我知道当使用一根手指时我可以执行以下操作来获取位置。 我也知道我可以在触摸开始回调中迭代触摸,但是我正在尝试利用 UILongPressGestureRecognizer 中的 ...

SwiftUI - 当手指移动一点时让 LongPressGesture 保持不变? - SwiftUI - Make LongPressGesture remain when finger moves a bit?

我有一个长按手势,有点像这样: 它工作正常,但问题是如果用户按下它,按住它,然后稍微移动他们的手指,那么LongPressGesture 就会停止触发。 我想以某种方式避免这种情况。 有没有办法做到这一点? 也许像增加 LongPressGesture 区域的半径? 这对于手指较大的人尤其有用。 ...

Swift - 如何使用 UILongPressGestureRecognizer 获取一组按钮的发件人标签? - Swift - How to get the sender tag for an array of buttons using UILongPressGestureRecognizer?

我在 storyboard 中有一些按钮,我将它们放入了参考插座集合中。 我对所有这些按钮都使用了 UITapGestureRecognizer 和 UILongPressGestureRecognizer,但是我怎样才能准确地打印出哪个按钮被点击了呢? 贝娄是我试过但没有用的。 我收到一条错误消 ...

在同一个 UIButton 上同时识别 UILongPressGestureRecognizer 和 UIPanGestureRecognizer - Recognize both UILongPressGestureRecognizer and UIPanGestureRecognizer on same UIButton

我想制作一个UIButton ,当你长按它时,它会开始录制视频,如果你垂直向上平移手指(同时仍然长按),视频会放大。 在我的按钮上,我添加了一个UILongPressGestureRecognizer和一个UIPanGestureRecognizer来实现这一点。 单独地,他们工作。 但是,它们不 ...

尝试调用长按手势并运行命令,但在函数中的选择器中遇到 SIGABRT 错误。 什么没有连接? - Trying to call a long tap gesture and run a command but running into a SIGABRT error with the selector in the function. What isn't connected?

我的代码: 然后我的函数在选择器中被调用: 但是,当我运行它并尝试长按按钮时,我收到此错误: -[UILongPressGestureRecognizer 标签]:无法识别的选择器发送到实例 0x7fbc5ce00680 我不知道是因为我命名标签错误还是因为我创建 LongPre ...

同时解析UITapGestureRecognizer和UILongPressGestureRecognizer并触发UIGestureRecognizer.State。 - Resolve UITapGestureRecognizer and UILongPressGestureRecognizer simultaneously and fire UIGestureRecognizer.State.began on finger touch down

首先,所有已经回答的问题都对我没有帮助 Swift:长按手势识别器-检测水龙头和长按 在表格视图中同时使用轻击手势和长按 长按手势识别器仅在手指松开时触发 等等 该代码几乎可以正常工作,只有一件事:长按手势仅在我将手指从屏幕上抬起时调用。 但是我需要表 ...

如何在longpress上显示用户选择的tableview单元格 - how show user selected cell of tableview on longpress

您好,我在UILongPressGesture中添加了UILongPressGesture ,并且添加成功,但问题是如何显示选中的单元格,我的意思是我想更改所选单元格的颜色,当我再次对选定的单元格进行长按时,我想删除的单元格 我试图用代码在我的表视图中添加长按并在LongPress上分配代 ...


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