开发者

How do you return draggable content to their original positions in iPhone dev?

开发者 https://www.devze.com 2023-01-03 02:23 出处:网络
I am wanting to create a button in my iPhone app that when touched will return other draggable elements to their ori开发者_高级运维ginal position.I have looked at the Apple \"MoveMe\' example, but tha

I am wanting to create a button in my iPhone app that when touched will return other draggable elements to their ori开发者_高级运维ginal position. I have looked at the Apple "MoveMe' example, but that returns the button to the center of the screen. I want to be able to position draggable objects around the screen, drag the objects within the app, and then return them to their original starting positions by pressing a designated button.

Any help appreciated!


Cache the initial positions of your draggable objects, and use an event handler on the button to reset their positions. I'm a little confused. The MoveMe example code is exactly what you need to answer your question -- what more do you want? You won't find a perfect code example for any arbitrary problem you can dream up.


Play around with saving the original positions and using MoveMe to reset the objects and I bet you'll have what your looking for in no time at all.

0

精彩评论

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