自定义圆形进度与图像中心 [英] Custom circular ProgressBar with image in center
本文介绍了自定义圆形进度与图像中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有关我的Android应用我想将图像在圆形进度条
。
预计设计:
For my android application I want put an image in a circular progress bar
.
Expected design:
这是如何做到这一点任何想法?
Any ideas on how to do that?
推荐答案
您可以把一个正常的布局文件: loader.xml
You can take a normal layout file: loader.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:clickable="false">
<ProgressBar
android:id="@+id/progressBar1"
style="@android:style/Widget.ProgressBar.Small.Inverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:layout_centerInParent="true"
android:padding="30dp"
android:clickable="false"/>
<ImageView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/img"
android:clickable="false"/>
</LinearLayout>
根据你的设计做了一点调整。
Do the little adjustment according to your design.
现在使用这个布局,进度对话框绘制。
Now use this layout as your progress dialog drawable.
这篇关于自定义圆形进度与图像中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文