我有一个从网上填充listview的活动。 当数据加载时,我想显示一个进度对话框而不是listview。进度条ICS
我的布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ProgressBar
android:id="@+android:id/progress_large"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<ExpandableListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
我这样做,这样的进度条显示本身(这一点也适用):
setProgressBarVisibility(true);
然而,一旦列表视图填充(用的AsyncTask)我希望进度条消失,而不是这种情况,它保持在列表视图之上。
以下是我在的AsyncTask那样:
@Override
protected void onPostExecute(Void result) {
setProgressBarVisibility(false);
//... and some code to update UI
}
我得到这样的:该方法解雇()是未定义的类型进度 – lost17
然后尝试progressBar.setVisibility(ProgressBar.GONE); – VendettaDroid
谢谢,它的作品! :) – lost17