iPhone iOS:如何在图像背景上动态移动/调整图像大小?
我有兴趣开发一个允许用户执行以下操作的应用程序:
- 设置背景图像
- 在背景图像顶部添加图像
- 允许用户通过触摸和拖动来移动图像
- 允许用户旋转/缩放这些图像
具体来说,我我有兴趣了解如何检测添加到背景图像顶部的其中一张图像中的触摸,如何检测哪个图像被触摸以便可以对其进行操作,维护 z 顺序等。
最好的方法是什么去做这件事吗?有示例代码吗?
I am interested in developing an app that allows a user to do the following:
- Set a background image
- Add images on top of the background image
- Allow user to move the images around by touching and dragging
- Allow user to rotate/scale these images
Specifically, I am interested in knowing how to detect a touch in one of the images that get added on top of the background image, how to detect which image is being touched so that it can be manipulated, maintain z-order, etc.
What's the best way to go about doing this? Any sample code out there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您分块解决这个问题:
找到每个元素的教程应该很容易。你的工作就是将它们整合在一起。
I suggest you tackle this in bite-sized chunks:
It should be quite easy to find tutorials for each of these elements. It's your job to put it all together.
你可以找到感动的观点,就像
我希望你现在有了一个“想法”。
另外在 google 和 stackoverflow 上搜索你会发现很多关于它的示例。
You can find the view which touched like
I hope now you have got an "IDEA".
Also search on google and stackoverflow you will find many samples about it.