2013-04-16 17 views
0

雖然網絡調用我在我的應用程序中顯示進度對話框。在當前屏幕上,我有三個按鈕。如何在顯示進度對話框時啓用這些按鈕?有沒有辦法做到這一點?雖然顯示ProgressDialog啓用應用程序功能

顯示進度對話框時是否可以啓用按鈕?

+0

嘗試在asyncTask中編寫進度對話框代碼 – Abx

+0

它在AsyncTask中。 – user2603

+0

糟糕!我錯過你的問題。我不認爲如果你可以做到這一點,當一個對話框被調用的活動轉移到暫停狀態。嘗試使用視圖,而不是 – Abx

回答

0

可以使用自定義對話框,folowwing XML:

<?xml version="1.0" encoding="utf-8"?> 
<Layout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1" > 
     <ProgressBar 
      android:id="@+id/progressbar" 
      android:layout_gravity="center" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      /> 
      <Button android:layout_height="match_parent" android:layout_width="wrap_content"/> 
    </LinearLayout> 

</LinearLayout> 

這只是一個例子 你可以有一個進度條和一個按鈕,這將是可見的。