开发者

How to move object

i am working on a project in which i have to provide user facility to d开发者_运维问答raw an circle . i have done this part. But new requirement is that user can move it at any his desire position.I have no idea about it.please help me.


Make a subview of UIView. In it, override drawRect: to draw your circle. Add it to a superview that is the size of the screen. Then, give your view a UIPanGestureRecognizer. Set the target/action to a method on your circle view, and in that method set the view's frame to have an origin at the gesture recogniser's locationInView:.

If you need more specific help than this, feel free to post some code that you're having trouble with.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜