2012-03-06 109 views
-3

我該如何做透明視圖。有誰能夠幫助我?透明視圖?

我想要做的就是這樣的:

enter image description here

+0

那麼什麼是概率使用popupwindow與圓角佈局和對齊中心... – 2012-03-06 16:14:37

+0

但它是透明的,你知道我該怎麼做? – DuyguK 2012-03-06 16:17:05

+0

爲什麼有人投票會出現什麼問題? – DuyguK 2012-03-11 10:48:01

回答

0

你應該只能夠改變疊加的不透明度/阿爾法。

3

創建一個佈局,並在使主題爲對話框您的清單

,並在佈局設置背景android:background="#885A2720"

編輯: 檢查此佈局在您看來

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:minWidth="250dp" 
    android:minHeight="380dp" 
    android:layout_gravity="center_vertical|center_horizontal" 
    android:background="#885A2720" style="@android:style/Theme.Holo.Dialog"> 


</LinearLayout> 
+0

這是不相關的背景顏色etc.I要透明視圖 – DuyguK 2012-03-06 16:28:15

+2

沒有任何嘗試不說什麼。 「#88 5A2720」這實際上是alpha顏色,您可以將值88更改爲希望範圍從00到FF。 – 2012-03-06 16:53:00

0

如果你會使用relativeLayout,然後使用imageView的高度和寬度match_parent。 並將圖片的alpha設置爲150dp。

0

使用可繪繪製矩形

爲完全透明,請使用以下繪製

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > 
    <solid android:color="#00000000" /> 
    <stroke android:width="0.3dip" android:color="#2f4f4f" 
     android:dashWidth="7dip" 
     android:dashGap="7dip"/> 
</shape> 

如果你想設置%的透明度,U可以設置使用的小部件的「阿爾法」屬性。請注意,沒有任何內容的文本框可以幫助您實現這一目標。