gpt4 book ai didi

ios - Swift/XCODE - 无法在 UIButton 上快速按下(触摸)

转载 作者:行者123 更新时间:2023-11-28 07:14:36 24 4
gpt4 key购买 nike

我有一个单 View 屏幕,里面有一个按钮覆盖了整个屏幕。我无法快速按下它,它有时会卡住。我玩过 Piano Tiles 游戏,您可以快速按下按钮而不会卡住。所以这是我的问题:1) 是否可以在 UIButton 上按非常快的乘法次数?2) 将按钮连接到代码(action)时,什么是touch down repeat option

我已经将 Action 设置为着陆,所以它会尽可能快,但仍然会正确流动。有什么建议吗?

最佳答案

我以前没有遇到过这个问题,但您可能需要考虑将 UITapGestureRecognizer 添加到 ViewController 的主视图,并使用它来检测您的点击而不是 UIButton。

Here's Apple's official docs .

This is a also a decent tutorial on it using Swift .我建议使用 Programmatic UIGestureRecognizers 进行快速设置。

关于ios - Swift/XCODE - 无法在 UIButton 上快速按下(触摸),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26868062/

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