UISlider(和其他 UI 元素)是否继承了手势识别器

发布于 2024-12-26 01:04:20 字数 148 浏览 0 评论 0原文

我只是好奇 UISlider 中是否有继承的平移手势识别器,或者 UI 元素是否与手势识别器分开。我的猜测是分开的。

基本上,我有另一种方法,由我们的一位顾问开发,该顾问已不再与我们在一起,该方法采用滚动视图的手势识别器来获取其 locationInView 属性。

I was just curious if a UISlider had an inherit pan gesture recognizer in it, or if UI elements are separate from gesture recognizers. My guess is separate.

Basically I have another method developed by one of our consultants who is no longer with us that takes in a gesture recognizer of a scrollView to get its locationInView property.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的笑 2025-01-02 01:04:20

手势识别器已经存在了一段时间,尽管它们只在 iOS 4.0 中公开。滚动视图实际使用的 UIScrollView 手势识别器只能通过 iOS 5.0 中的公共 SDK 进行访问,尽管您可以在以前的 iOS 版本中通过一些代码技巧来获取它们。

UISlider 可能在底层使用手势识别器,或者它可能只使用 touchesBegantouchesEnded 等方法。不管怎样,这都不是暴露给你的东西。理论上可以通过实验找到这一点,但如果您开始使用公共 SDK 中未公开的功能,您将面临在较新的 iOS 版本中出现故障的风险(过去曾发生过这种情况)。

Gesture recognizers have existed for some time, although they were only made public in iOS 4.0. The UIScrollView gesture recognizers that are actually used by the scroll view were only made accessible through the public SDK in iOS 5.0, although you could get hold of them in previous iOS versions through some code trickery.

It's possible that a UISlider uses gesture recognizers under the hood, or it may just use the touchesBegan, touchesEnded, etc methods. Either way, it's not something that is exposed to you. It would in theory be possible to find this out through experimentation, but if you start using functionality that isn't exposed in the public SDK you run the risk that it will break in a newer iOS version (this has happened in the past).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文