作者:
vvrr (vvrr)
2014-12-25 12:37:12最近開始摸Android 的UI,發現了這個問題:
我的Layout想做成
在一個基本的排版上面再蓋一個TextView並且半透明,
1. 當touch到這個TextView的時候它會消失,再給user控制底下的東西
2. 當按back鍵,這個TextView會再蓋回來.
大概是這樣(我把和background有關的設定寫上來):
<AbsoluteLayout
android:background="@drawable/background"
>
<TableLayout
android:background="@drawable/background"
>
<ImageButton
android:background="#00000000"
/>
</TableLayout>
<TextView
android:id="@+id/TextViewOverlay"
android:background="#E0000000"
/>
</AbsoluteLayout>
程式部份,
我呼叫了 setVisibility(View.GONE),TextView的確消失了
呼叫 setVisibility(View.VISIBLE)的時候,TextView也回來了(上面的字有顯示)
但是原本應該是半透明的背景卻變成全透明……
想請問這原因可能出在什麼地方呢?