两个图片,制作帧动画
需要注意的是,需要使用clip节点来指定android:clipOrientation和android:gravity="left",否则可能出现不同屏幕显示不完整的情况
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:variablePadding = "true">
<item android:duration="100">
<clip xmlns:android="http://schemas.android.com/apk/res/android"
android:clipOrientation="horizontal"
android:drawable="@drawable/loading_pic1"
android:gravity="left">
</clip>
</item>
<item android:duration="100">
<clip xmlns:android="http://schemas.android.com/apk/res/android"
android:clipOrientation="horizontal"
android:drawable="@drawable/loading_pic2"
android:gravity="left">
</clip>
</item>
<item android:duration="100">
<clip xmlns:android="http://schemas.android.com/apk/res/android"
android:clipOrientation="horizontal"
android:drawable="@drawable/loading_pic3"
android:gravity="left">
</clip>
</item>
<item android:duration="100">
<clip xmlns:android="http://schemas.android.com/apk/res/android"
android:clipOrientation="horizontal"
android:drawable="@drawable/loading_pic4"
android:gravity="left">
</clip>
</item>
</animation-list>
Android 系统已经被各大厂商改的面目全非,各种系统组件在不同手机上显示的效果完全不同,现在要想在开发中想要保持统一的界面风格,必须全部修改系统组件的 样式 ,现在我们需要修改系统默认的 ProgressBar ,就 Android 系统本身来说,不同的版本组件的 样式 也不同。vcD4NCjxoMiBpZD0="系统中progressbar样式">系统中 ProgressBar 样式
找到android-sdk目录下的platforms\android-15\data\res\values中的styles.xml,然后查找ProgressBar,可以发现
android:indeterminateDrawable的值为@android:drawable/progress_medium_white,找到drawable目录下的progress_medium_white.xml,打开
就是一个简单的spinner_white_48.png的旋转动画
自定义android:indeterminateDrawable的值 旋转动画然后
即可制作简单的旋转样式的的ProgressBar
帧动画 还有一种样式的为帧动画,这里有一点需要注意的
两个图片,制作帧动画
需要注意的是,需要使用clip节点来指定android:clipOrientation和android:gravity="left",否则可能出现不同屏幕显示不完整的情况