开发者

Move UIImageView along the x-axis using a UIGestureRecognizer

I have four UIImageViews lined up in a row and I want to be able to move the images from left to right. Is there a way to bound the movement to the x-axis (along the image centers) i.e. moving them only left and right? Similar to moving the icons around the screens on an iPhone.

I've added a 开发者_如何学PythonUIPanGestureRecognizer to each of the views which allows me to move them around everywhere on the screen.

Any thoughts?


Well, if you don't want movement on the y axis, don't modify the y axis. Just change the x coordindate according to the gesture recognizer's movement. What exactly is the problem?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜