开发者

creating iPhone draggable objects

开发者 https://www.devze.com 2022-12-29 01:46 出处:网络
I need to figure out how in the world do I create ob开发者_StackOverflow社区ject instances (an image) and place them on the screen and have it draggable. I know how to draw an image (png) onto the scr

I need to figure out how in the world do I create ob开发者_StackOverflow社区ject instances (an image) and place them on the screen and have it draggable. I know how to draw an image (png) onto the screen, but how do I make it draggable?


Create sublclasses of UIView where you override the touchesEnded method. Inside this method alter the coordinates of the view to match those of the most recent UITouch, and that will give you basic draggable views.

0

精彩评论

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