Android “仅进程控制盘进行中”对话框
当我的活动正忙于准备某些内容时,我想显示一个进度对话框 问题是我只想让进度轮显示在对话框屏幕上,而不是它 当前,我正在显示一个进度对话框,其中黑色对话框上的进度轮正在旋转Android “仅进程控制盘进行中”对话框,android,progressdialog,Android,Progressdialog,当我的活动正忙于准备某些内容时,我想显示一个进度对话框 问题是我只想让进度轮显示在对话框屏幕上,而不是它 当前,我正在显示一个进度对话框,其中黑色对话框上的进度轮正在旋转 将图像作为参考。(右下角)。将其放在XML布局中需要“进度轮”的位置 将布局包装到相对布局中 <RelativeLayout ...> <yourlayout....> </yourlayout> <ProgressBar.... andr
将图像作为参考。(右下角)。将其放在XML布局中需要“进度轮”的位置
将布局包装到相对布局中
<RelativeLayout ...>
<yourlayout....>
</yourlayout>
<ProgressBar....
android:visibility = "gone"/>
</RelativeLayout>
然后,每当您希望显示和隐藏进度时,只需将可见性设置为gone/visible即可。我非常确定,进度条可以有一个透明的背景,因此它将为您提供一个控制盘。以下代码将添加一个进度条,而活动底部没有对话框:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:background="@drawable/splashscreen"
android:gravity="center_horizontal"
android:layout_height="match_parent"
android:orientation="vertical">
<ProgressBar
android:layout_alignParentBottom="true"
android:layout_marginBottom="24dp"
android:layout_width="32dip"
android:layout_height="32dip">
</ProgressBar>
</RelativeLayout>
你要找的就是方向盘,其他什么都没有?如果是这样的话,就有一个圆形的进度条。是的,我只找那个轮子。android有一个循环的进度条,但它也提供了一个我不需要的类似背景的对话框。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:background="@drawable/splashscreen"
android:gravity="center_horizontal"
android:layout_height="match_parent"
android:orientation="vertical">
<ProgressBar
android:layout_alignParentBottom="true"
android:layout_marginBottom="24dp"
android:layout_width="32dip"
android:layout_height="32dip">
</ProgressBar>
</RelativeLayout>