skink wrote: > ok, i found it. > > animation stuff works OK: it rotates tho whole view (not image > bounds), run hierarchyviewer and > you'll see that pivot is ok. > > if you try to rotate image itself, try this > > ImageView iv = (ImageView) findViewById(R.id.iv); > Matrix matrix = iv.getImageMatrix(); > RectF dst = new RectF(); > matrix.mapRect(dst, new RectF(iv.getDrawable().getBounds())); > Log.d("Test", "Dst " + dst); > RotateAnimation a = new RotateAnimation(0, 360, iv.getPaddingLeft() + > dst.centerX(), iv.getPaddingTop() + dst.centerY()); > a.setDuration(5000); > iv.startAnimation(a);
In my case, it may be simpler to just get rid of the padding* attributes and use shims to shove the ImageView into the proper position. I'll try it both ways and see which seems more maintainable. But padding is the problem: once I get rid of the padding* attributes, it rotates just fine. So, as you indicated, RotateAnimation rotates the whole view, which *includes* padding. Thanks again for your help! -- Mark Murphy (a Commons Guy) http://commonsware.com Android Training in Sweden -- http://www.sotrium.com/training.php --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---