[問題] TextView setVisibility後背景不見
最近開始摸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也回來了(上面的字有顯示)
但是原本應該是半透明的背景卻變成全透明……
想請問這原因可能出在什麼地方呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.250.31.103
※ 文章網址: http://www.ptt.cc/bbs/AndroidDev/M.1419482235.A.317.html
→
12/25 14:16, , 1F
12/25 14:16, 1F
→
12/25 14:40, , 2F
12/25 14:40, 2F
→
12/25 14:58, , 3F
12/25 14:58, 3F
→
12/25 15:19, , 4F
12/25 15:19, 4F
→
12/25 15:20, , 5F
12/25 15:20, 5F
→
12/25 15:20, , 6F
12/25 15:20, 6F
→
12/25 15:20, , 7F
12/25 15:20, 7F