问题标签 [uipangesturerecognizer]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1102 浏览

iphone - UIPanGestureRecognizer 可以很好地移动视图,但有时会跳动

我正在通过这段代码移动视图,它运行良好,但有时它们非常跳跃,对此有什么想法吗?

0 投票
0 回答
533 浏览

iphone - UIButton pointInside

I have two buttons in a subclass of UIControl. I am dragging one of the two using a gesture recognizer and when panGestureRecognizer.state==UIGestureRecognizerStateEnded I want to check if the center of my second button is inside the frame of the button I have just dragged. Apparently, for some reason, [btnDragged pointInside: btn2.center withEvent:nil] doesn't ever return YES.

Is there any other solution? (I know I can work with coordinates and check directly, but I don't want to write too much code)

0 投票
2 回答
434 浏览

objective-c - UIImageView 手势数组

在我看来,有一个 UIImageView 数组。我尝试添加平移手势,我的 UIImageView 能够移动。但问题是在我将第二个 UIImageView 插入数组后,当我触摸前一个 UIImageView 时,我能够移动 UIImageView。

如何限制当前 UIImageView 内的触摸?

0 投票
3 回答
21948 浏览

ios - ios UIPanGestureRecognizer 指针位置

上面的代码将记录我当前平移的相对位置,但我怎样才能获得我所在视图的绝对位置?

我只是想将 a 滑动UIImageView到用户手指所在的位置。

0 投票
2 回答
2691 浏览

ios - UIPanGestureRecognizer 不能平滑移动物体

我试图使用 UIPanGestureRecognizer 来移动我的对象,但我似乎无法让它顺利移动。当我朝一个特定的方向移动并转向相反的方向时,它不会立即做出反应。我认为该值可能有问题,因为它在“->”方向上为正,在“<-”方向上为负。

我的代码如下:

有没有人有更合适的方法来解决这个任务?

提前致谢。

0 投票
1 回答
259 浏览

ios - IOS:UIPanGesture 不适用于 ios 4.3

我的应用程序中有这个角色:

}

它在 ios 5 中可以正常工作,但在 ios 4.3 中却不行……为什么???

0 投票
0 回答
325 浏览

objective-c - 平移手势识别器中断 UIButton 突出显示

我将 UIPanGestureRecognizer 和 UITapGestureRecognizer 添加到 UIButton 以获得自定义效果。但是当我平移按钮时,之前点击引起的突出显示消失了。我怎样才能摆脱它?或者给我一种在被触摸时手动处理视图的高亮效果的方法。谢谢。

0 投票
1 回答
139 浏览

ios - 同时平移多个图像

我想知道是否可以使用多点触控同时拖动/平移多个图像

即:使用一根手指拖动一个图像,同时使用另一根手指拖动另一个图像,我想使用 UIGestureRecognizer 来实现这一点。

如果是这样,我想知道我应该怎么做。

编辑:我用于平移的代码

0 投票
1 回答
120 浏览

objective-c - UIGestureRecognizer 在 ipod 上给我错误但在 iphone 模拟器中没有?

在我的程序中,我声明了 aUIPanGestureRecognizer并且它在 iPhone 模拟器中运行良好。但是,当我在我的 iPod (iOS 3.1) 上运行它时,它给了我错误[UIPanGestureRecognizer locationInView:]: unrecognized selector sent to instance 0x11cd80.有人知道如何解决这个问题吗?谢谢!

0 投票
2 回答
2231 浏览

objective-c - 制作屏幕外可拖动视图(如 iOS 5 通知中心)

我想制作一个最初在屏幕左侧不可见的视图。当手指从屏幕的最左侧平移时,左侧出现并跟随手指。我的意思是完全像 iOS 5 中的通知中心,但在左侧......

这是我想要的图片:http: //i.imgur.com/Bb6tC.png

我的问题是下面的视图上有一个滚动视图,并且 PanGestures 正在干扰......

我试图在下面的视图中仅在定义的区域上捕捉触摸,如下所示:

我也使用了委托方法

但是,我仍然无法让所有这些平移手势不相互干扰......请问有什么想法吗?:-)