2011-10-12 64 views
0

我使用的定製進度對話框爲here,如下所示。紡車處於中心​​位置,我無法找到如何設置自定義位置。在定製進度對話框中定位紡車輪

有人可以幫忙嗎?

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="NewDialog"> 
     <item name="android:windowFrame">@null</item> 
     <item name="android:windowBackground">@android:color/transparent</item> 
     <item name="android:windowIsFloating">true</item> 
     <item name="android:windowContentOverlay">@null</item> 
     <item name="android:windowTitleStyle">@null</item> 
     <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> 
     <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> 
     <item name="android:background">@android:color/transparent</item> 
    </style>  
</resources> 

回答

0

使用進度在佈局中。你可以將它放置在你想要的屏幕上的任何位置。

<ProgressBar android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       style="?android:attr/progressBarStyle"    
       android:id="@+id/showProgress"/> 
+0

我需要一個默認大小的轉輪,並且有一個透明的(比如#50000000)背景填充父項。如果我在ProgessBar中將android:layout_width和android:layout_height設置爲'fill_parent',我會得到一個巨大的轉輪。根據我在我的問題中提供的鏈接,只能通過自定義對話框完成。唯一的問題是車輪居中,我想設置一個自定義的位置。你有另一種解決方案嗎? – jul

+0

你可以看到這個鏈接。我在我的博客中添加了代碼。 http://sujitdroid.blogspot.com/2011/10/custom-progressdilaog-like-iphone.html – Sujit