将 UIPanGestureRecognizer 应用于同一个按钮时如何访问 uibutton

Posted

技术标签:

【中文标题】将 UIPanGestureRecognizer 应用于同一个按钮时如何访问 uibutton【英文标题】:How can access the uibutton ,when apply the UIPanGestureRecognizer to the same button 【发布时间】:2012-01-19 05:47:07 【问题描述】:

我是 ios 开发新手。现在,我正在使用 GestureRecognizer 开发一个小型应用程序。 在我的应用程序中有一些 uibuttons,这些按钮响应 UIPanGestureRecognizer。 现在我想在应用 UIPanGestureRecognizer 时识别哪个按钮正在拖动。

如果有人知道。请澄清我的问题。

【问题讨论】:

【参考方案1】:

也许这样的东西对你有用

- (void)pan:(UIPanGestureRecognizer *)gesture

    UIButton *button = (UIButton *)gesture.view;

【讨论】:

以上是关于将 UIPanGestureRecognizer 应用于同一个按钮时如何访问 uibutton的主要内容,如果未能解决你的问题,请参考以下文章

将 UIPanGestureRecognizer 速度添加到 UIViewPropertyAnimator

将 UIPanGestureRecognizer 快速限制为边界

使用 UIPanGestureRecognizer 时如何将超级视图与视图一起居中?

需要在 iOS 中使用 UIPanGestureRecognizer 将 UIImageView 的移动限制在 UITableView 覆盖的区域

将 UIPanGestureRecognizer 应用于同一个按钮时如何访问 uibutton

您需要采取哪些步骤将 UIPanGestureRecognizer 触摸转换为 ScrollView 缩放?