2016-03-23 191 views
0

我設置了進度對話框的主要活動,我在進度對話框(使用自定義進度對話框)上設置了custom_dialog.xml佈局,您從圖片中顯示從主活動有頂部和底部區域顯示,我想佈局或在所有頁面或屏幕像飛濺活動進度對話框顯示顯示所有主佈局的佈局

1

custom_dialog.xml ::

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/icon" > 

<ProgressBar 
    android:id="@+id/progressBar" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center_horizontal"/> 

</RelativeLayout> 

如何通過XML或Java代碼解決呢?

+0

你要問,爲什麼你的進度條是不是在你的活動展示? –

+0

「佈局不顯示在所有主佈局上」 - 也許這是因爲您的其他「主佈局」沒有ProgressBar? –

+0

不,進度條顯示,顯示上面的圖像,你看到一些主要內容,我會隱藏它,我的意思是我會顯示進度佈局,如啓動畫面 –

回答

0

試試這個

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

    <ImageView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     androud:scaleType="fitXY" 
     android:background="@drawable/icon" 
    /> 

    <ProgressBar 
     android:id="@+id/progressBar" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_horizontal"/> 

    </RelativeLayout> 
+0

謝謝:)它的工作,我從圖像視圖中刪除scaleType因爲有錯誤(屬性是缺少android命名空間),我添加了內容說明:)謝謝 –

+0

如何解決這個問題,在巨大的屏幕圖片 http://dorraq.net/uploads/642016-104136AM-1.jpg –