开发者

How to control an animation via touch

开发者 https://www.devze.com 2023-02-18 22:35 出处:网络
I\'m creating an app that uses a disk to browse files and such, like this: http://dl.dropbox.com/u/8051037/disk_ab1.png

I'm creating an app that uses a disk to browse files and such, like this: http://dl.dropbox.com/u/8051037/disk_ab1.png

开发者_JS百科I want to make it be able to spin as the user turns it, and I know I need to use a RotateAnimation, but I can't figure out how to make it follow the finger.


I think you should use a custom view, see this examle which rotates a ball: How can I use the animation framework inside the canvas?

then you can use motion event to control the angle of rotation: Android firing onTouch event for multiple ImageViews

Custom view can be transparent so you can combine it with other veiws in your layout.

0

精彩评论

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