Android Image Rotation not working in ice cream sandwich

I have an image that is set to rotate in my application. The code works great on all versions of Android except the latest Ice Cream Sandwich. The image still rotates, but it does not rotate from the center axis of the image. Instead, it rotates from the left corner (0,0) of the image. Anyone have any ideas as to why this doesn't 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));

Thank!

+5
source share
2 answers

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

+1
source

I'm going with

android:pivotX = "0.5"
android:pivotY = "0.5"
0

All Articles