0

You can rotate an ImageView with

ImageView.setRotation(float rotation);

But can you scale?

EDIT: Something like this...

ImageView icon = (ImageView) findViewById(R.id.icon);
for (int i = 0; i < 90; i++){
    Log.i("Rotate", "Rotating icon by " +    String.valueOf(i) + " degrees.");
    Log.i("Scale",   "Scaling icon by " + String.valueOf(i/90) + " degrees.");
    icon.setRotation(i); // rotate by i degrees (0 to 90)
    icon.setScale(i/90); // scale by i/90 (0 to 100%)
    try{Thread.sleep(5);}// sleep for a little bit
    catch(InterruptedException e){}
}

Should produce a result like... (without the translation) enter image description here

ChickenFeet
  • 2,653
  • 22
  • 26
  • Possible duplicate of [Android image view matrix scale + translate](http://stackoverflow.com/questions/6075363/android-image-view-matrix-scale-translate) – Doug Stevenson Feb 25 '16 at 06:56

1 Answers1

2

You can scale the ImageView in code using

myImageView.setScaleType(ImageView.ScaleType);

ImageView.ScaleType is an enum with all the values.

Ahmed Hegazy
  • 12,395
  • 5
  • 41
  • 64