Android -- 自定义ProgressBar图片
注:所有的进度条都要配置
android:indeterminate="false"
android:indeterminateDrawable="样式文件名称"
1. 图片旋转
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <rotate android:drawable="@drawable/dialog_progress_round" android:fromDegrees="0.0" android:pivotX="50.0%" android:pivotY="50.0%" android:toDegrees="360.0" /> </item> </layer-list>
2. 动画效果
<?xml version="1.0" encoding="UTF-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false" > <item android:drawable="@drawable/loading_01" android:duration="150"/> <item android:drawable="@drawable/loading_02" android:duration="150"/> <item android:drawable="@drawable/loading_03" android:duration="150"/> <item android:drawable="@drawable/loading_04" android:duration="150"/> <item android:drawable="@drawable/loading_05" android:duration="150"/> <item android:drawable="@drawable/loading_06" android:duration="150"/> <item android:drawable="@drawable/loading_07" android:duration="150"/> </animation-list>
3. 颜色
<?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" > <shape android:innerRadiusRatio="3" android:shape="ring" android:thicknessRatio="8" android:useLevel="false" > <gradient android:centerColor="#FFDC35" android:centerY="0.50" android:endColor="#CE0000" android:startColor="#FFFFFF" android:type="sweep" android:useLevel="false" /> </shape> </rotate>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。