iPhone:如何如下所示拖动或移动UIImage / UIButton? [英] iPhone : How do I drag or move UIImage/UIButton as shown below?

查看:164
本文介绍了iPhone:如何如下所示拖动或移动UIImage / UIButton?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何在我的应用中获取以下类型的功能。

I dont know How to get following type of functionality in my app.

如上图所示,用户可以滑动(拖动)不同的图像部分,用户可以组合图像。

As shown in above figure user can slide(drag) different image parts and user can assemble image.

任何人都能告诉我这是什么控制?或者任何教程?

Can any one tell me which control is this ? Or any tutorial for it ?

推荐答案

查看MoveMe示例应用程序。它将向您展示如何允许通过触摸和拖动移动子视图。

Check out the MoveMe sample app. It will show you how to allow movement of subviews by touch and drag.

然后,您可以为每个可以移动的拼图创建imageView。

You can then create imageViews for each of your puzzle pieces that can be moved around.

一旦你完成了这件事,你需要检查一件作品的移动过程,看看它是否接近到它的正确的位置在拼图,所以它可以卡入到位

Once you have accomplished this you need to check during movement of a piece to see when it gets close enough to it's correct spot in the puzzle so it can snap into place when then user lets go of the piece.

http://developer.apple.com/library/ios/#samplecode/MoveMe/Introduction/Intro.html

这篇关于iPhone:如何如下所示拖动或移动UIImage / UIButton?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆