我在RelativeLayout中有一個列表視圖,它從AsyncTask自動加載內容。現在我想在列表視圖的頂部添加一個水平進度條,以便在元素加載時顯示進度(不在疊加層上)。我嘗試了一些方法,但進度條沒有正確顯示。什麼是正確的做法?在RelativeLayout中顯示列表視圖的進度條
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/listViewTitle"
android:layout_alignParentTop="true" />
<ListView
android:id="@+id/listViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
</ListView>
該問題指定:「...不在疊加層上」。然後你的建議(一個對話框)將不起作用。你能更新你的答案嗎? – Vikram