2012-03-15 46 views
4

我想在我的活動中創建一個透明視圖。活動顯示在一個標籤的點擊上。我想要的是當我點擊我的活動中的任何圖像時,透明視圖會覆蓋該活動,但我的選項卡仍可點擊。另外,當透明視圖被創建時,活動的後臺項目不應該是可點擊的。可能嗎? 而如何能夠在android中實現這一點?如何在android中的另一個視圖上創建透明?

回答

2
//test.xml 

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/ic_launcher" 
    android:orientation="vertical" > 
    <LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@android:color/transparent" 
    android:orientation="vertical" > 
</LinearLayout> 
</LinearLayout> 
0

這允許所述重疊圖像通過點擊要傳遞給任何按鈕在它之下:

<ImageView 
    ... 
    android:clickable="false" 
    ... 
    /> 

(而當其設置爲true,所述的ImageView通吃點擊)

相關問題