android-带有实心圆的自定义圆形进度栏
作者:互联网
我想要一个这样的圆形进度栏
我尝试了此方法,但它看起来不像圆形,以及如何将动画与渐变一起使用,因为当前我对所有六个圆圈都使用相同的xml.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="15dp"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:src="@drawable/circle_shape_big_custom_search" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:src="@drawable/circle_shape_big_custom_search" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="72dp"
android:src="@drawable/circle_shape_big_custom_search" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="72dp"
android:src="@drawable/circle_shape_big_custom_search" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="15dp"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:src="@drawable/circle_shape_big_custom_search" />
<ImageView
android:layout_width="wrap_content"
android:layout_marginTop="5dp"
android:layout_height="wrap_content"
android:src="@drawable/circle_shape_big_custom_search" />
</LinearLayout>
任何帮助将非常感激.
解决方法:
定义进度条,如beloew代码snip:
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:indeterminateDrawable="@drawable/my_progress_indeterminate"
android:visibility="gone" >
</ProgressBar>
my_progress_indeterminate.xml [将此文件放在可绘制中]
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/image_for_rotation"
android:pivotX="50%"
android:pivotY="50%" />
将此图像文件放在这里在drawale中:
image_to_be_place_in_drawable
标签:progress-bar,android 来源: https://codeday.me/bug/20191120/2043052.html