开发者

How to move object

开发者 https://www.devze.com 2023-03-14 10:21 出处:网络
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 h

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

精彩评论

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