0

I've been trying to achieve an smooth rotation of a drawer in pre honeycomb devices, but it was impossible for me:

In my layout.xml

<ProgressBar
    style="@style/ProgressBarLarge"
    android:layout_centerInParent="true" />

in styles.xml

<!-- ProgressBar style -->
<style name="ProgressBarLarge" parent="@android:style/Widget.ProgressBar.Large">
    <item name="android:layout_width">@dimen/large_size</item>
    <item name="android:layout_height">@dimen/large_size</item>
    <item name="android:indeterminateDrawable">@drawable/progress_large</item>
</style>

and finally, here is my drawable:

<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/spinner_green_76"
    android:pivotX="50%"
    android:pivotY="50%"
    android:repeatCount="infinite"
    android:toDegrees="720" />

It works smoothy on Api 11 + devices, but on pre... it gets barred or slowly...

I'm desperate, I've tried to change the rotate drawer, change drawable resource to the right api version, but I couldn't get anything

4

1 回答 1

0

为避免对每张图像进行处理,您可以在计算机上对其进行预处理,然后使用Frame 动画

以 XML 定义的动画,按顺序显示一系列图像(如电影)。

于 2013-05-19T09:56:46.300 回答