【发布时间】:2012-10-31 05:25:42
【问题描述】:
我想更改ProgressBar 的默认动画,所以我在我的主题中添加了自定义样式:
styles.xml
<style name="ProgressTheme" parent="@android:style/Widget.ProgressBar.Large">
<item name="android:indeterminateDrawable">@drawable/spinner_holo_light</item>
</style>
我在我的ProgressBar 中调用了这种风格:
ProgressBar.xml
<ProgressBar
android:id="@+id/loadingProgressBar"
style="@style/ProgressTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
问题出在spinner_holo_light.xml内部:
如果我使用以下内容,则在 os 3.0+ 的设备上一切正常,但在较旧的 os 版本上进度不会旋转:
spinner_holo_light.xml
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/spinner_76_inner_holo"
android:fromDegrees="720"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="0" />
但如果我改用animate-rotate,动画在每个操作系统版本上都有效,但结果是一个非常滞后的动画。
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/spinner_76_inner_holo"
android:fromDegrees="720"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="0" />
你怎么看?我在这里做错了吗?
【问题讨论】:
标签: android animation rotation progress-bar