我想在屏幕中心显示进度条,但它不会显示在屏幕中间。以下是我的布局。我在这里做错了什么?基本上这是一个布局,显示图像和Android画廊部件在上面。当用户点击缩略图时,我正在从网络加载图像,我想在加载图像时显示进度对话框。如何在屏幕中心设置android进度条
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/container" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<Gallery android:id="@+id/gallery" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:gravity="top" />
<ImageView android:id="@+id/actualimage" android:scaleType="fitCenter"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:visibility="gone" android:layout_gravity="center_vertical|center_horizontal|center"
android:adjustViewBounds="true" />
<ProgressBar android:id="@+android:id/progress_small1"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:visibility="visible" android:layout_gravity="center_vertical|center_horizontal"
android:gravity="center_vertical|center_horizontal" />
</LinearLayout>
或者只是使用Progr ess Dialog,由Andro Selva推荐(取决于造型需求/喜好) –
Relative Layout为我做了诀窍。非常感谢 – Chandu