0

I am developing a simple application. I have an image(for e.g a wheel) on image view. I want to turn the image according to my finger moves(like rotating the wheel by hand) and stops it when i release the touch. I just rotate the image with simple animation without touching the screen. Kindly provide me a solution.

Eldo Varghese
  • 77
  • 1
  • 1
  • 7

1 Answers1

2

Take a look at this.

You will have to create a custom view and handle the onTouch events to calculate rotation angle.

In onDraw method

  1. Save the canvas state.
  2. Rotate the canvas using Camera class.
  3. Draw the image on the canvas.
  4. Restore the canvas
vKashyap
  • 580
  • 6
  • 17
  • thanks buddy.saw the link. but using that when i creating the xml i get the error: error parsing xml: unbound prefix. – Eldo Varghese Sep 04 '12 at 11:16
  • check if you have defined `xmlns:android="http://schemas.android.com/apk/res/android"` for more help [visit](http://stackoverflow.com/questions/2221221/frequent-problem-in-android-view-error-parsing-xml-unbound-prefix) – vKashyap Sep 04 '12 at 12:05