Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Image Rotation Not Working in Ice Cream Sandwich

I have an image that is set to rotate in my application. The code works perfectly on all Android versions except for the latest Ice Cream Sandwich. The image still rotates, but it is not rotating from the center axis of the image. Instead, it seems to rotate from the left corner (0,0) of the image. Does anyone have any ideas as to why this does not work in Ice Cream Sandwich? Here is my code:

rotator.xml:

<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1200"
    android:fromDegrees="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:repeatCount="infinite"
    android:toDegrees="360" />

animation.java:

status.setImageResource(R.drawable.pending);
status.startAnimation(AnimationUtils.loadAnimation(_context, R.anim.rotator));

Thanks!

like image 220
littleK Avatar asked Nov 13 '22 12:11

littleK


1 Answers

It seems that the answer to this question Android Toast notification is too small in Ice Cream Sandwich also solved my spinner problem.

like image 117
littleK Avatar answered Nov 16 '22 02:11

littleK