当我的活动忙于准备一些东西时,我想要显示一个进度对话框。
问题是我只想显示进度轮,而不是对话框屏幕。
目前我正在显示一个进度对话框,上面有一个黑色的对话框,进度轮在上面旋转。
将图片作为参考。(右下角)。

发布于 2011-12-04 08:18:40
下面的代码将在活动底部添加一个没有对话框的进度条:
<?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>发布于 2011-12-03 23:25:53
把它放在你的XML布局中你想要的“进度轮”的地方。
<ProgressBar
android:indeterminate="true"
android:id="@+id/marker_progress"
style="?android:attr/progressBarStyle"
android:layout_height="50dp" />发布于 2011-12-04 05:49:18
在相对布局中包装您的布局
<RelativeLayout ...>
<yourlayout....>
</yourlayout>
<ProgressBar....
android:visibility = "gone"/>
</RelativeLayout>然后当你想要显示和隐藏进度时,只需将可见性设置为gone/Visibl.我非常确定你可以在进度条上有一个透明的背景,所以它只会给你一个轮子.
https://stackoverflow.com/questions/8367825
复制相似问题