[英]Android Progress Bar slow rotation on pre HoneyComb devices
我一直在尝试使预蜂窝设备中的抽屉平稳旋转,但是对我来说这是不可能的:
在我的layout.xml中
<ProgressBar
style="@style/ProgressBarLarge"
android:layout_centerInParent="true" />
在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>
最后,这是我的可绘制对象:
<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" />
它可以在Api 11 +设备上正常运行,但是在...之前被禁止或缓慢...
我很拼命,我试图更改旋转抽屉,将drawable资源更改为正确的api版本,但是我什么也没得到
为了避免处理每个图像,您可以在计算机上对其进行预处理,然后使用Frame动画 :
用XML定义的动画,可以按顺序显示一系列图像(如电影)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.