android - Rotating an ImageView within a Layout... how? -
I have a layout with an image (embedded in an image view) I need to rotate the image (let's go Say) 90 degree CCW
I've written the code to rotate the image ...:
Expands the main activity activity of the public class {Private image view mImageView = null; Private Animation mRotateAnimation = null; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); SetContentView (R.layout.main); MImageView = (ImageView) findViewById (R.id.my_image); MRotateAnimation = AnimationUtils.loadAnimation (this, R.anim.my_rotate_90); } @ Override Public Boolean On-Touch Event (Motion Event Event) {if (event.getAction () == MotionEvent.ACTION_DOWN} {mImageView.startAnimation (mRotateAnimation); Back true; } Return super. Tonentange (event); }}
The image spins 90 degrees easily, but then comes back to its original state. This Android document says what will happen after the animation is over. Probably, on the notification ending on the animation, I want to change the ImageView (or the underlying drawables), and may potentially invalidate it to trigger Radra.
All well and good, strong> I have no way of doing this, and I can not find any such example of anyone else .
I do not have any obvious effect on getImageMatix
/ setImageMatrix
, with no obvious effect there are sub-classes of Chitrakoot which are Rotate the image, but there is no set drawer () method on the image view, so I do not know how to use it.
I have searched for examples; Although some of them include animation and rotation (especially Lunarlender), none of these images are animating the scene, and then leaving it in some converted state.
Surely I'm missing something simple here ... Aarag, how do you rotate an image view in the layout?
Thank you.
The image view will configure the drawables in the SetImageDrawable image. This should allow you to use the image squares, and thus use the matrix function on it.
Comments
Post a Comment