我想爲我的textview
背景色設置一個透明的黑色。我該怎麼做?TextView和背景顏色
3
A
回答
3
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<gradient
android:startColor="#2fDEDEDE"
android:endColor="#2F000000"
android:angle="270" />
<stroke
android:color="#cbc9c9" />
<corners
android:radius="3dp" />
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="@android:color/transparent"
android:endColor="@android:color/transparent"
android:angle="270" />
<stroke
android:color="#c3c2c2" />
<corners
android:radius="4dp" />
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" />
</shape>
</item>
用法:==> android:background="@drawable/btn_trans"
如果你想設置黑色
android:background="#000"
0
使在Photoshop圖像透明,並應用它來TextView的背景... 完蛋了,你有透明背景的文本視圖
0
設置研究背景顏色如果您使用的顏色與8個數字,而不是6如下
android:background="@android:color/transparent"
8
android:background="#55000000"
,前兩個設置不透明度。在這種情況下,不透明度是0x55,即85/255 [不透明度大約爲33%]。
爲程序化的,你應該能夠使用以下(其中myTextView對應到View)
myTextView.setBackgroundColor(0x55000000);
+1
唯一的回答OP問題,國際海事組織 – 2013-07-10 07:58:25
相關問題
- 1. 更改TextView觸摸的背景顏色
- 2. Android TextView文本背景顏色
- 3. 動態設置textview背景顏色
- 4. Android Textview背景顏色資源
- 5. 背景顏色和背景在一次
- 6. android:帶有動態背景顏色的圓角背景的TextView
- 7. 如何改變背景顏色和背景顏色?
- 8. 顏色背景
- 9. UISearchBar和UISearchDisplayController背景顏色
- 10. CSS,phpBB和背景顏色
- 11. Android的自定義對話框的TextView和背景顏色
- 12. CodenameOne TextView前景顏色
- 13. DBVisualizer背景顏色
- 14. UIView背景顏色
- 15. iframe背景顏色
- 16. ListBoxItem背景顏色
- 17. Bootstrap:Div背景顏色
- 18. NILauncherView背景顏色
- 19. Uipicker背景顏色
- 20. HTML背景顏色
- 21. 組背景顏色
- 22. FieldSet背景顏色
- 23. EditText背景顏色
- 24. Win32背景顏色
- 25. 背景顏色行
- 26. UIAlertAction背景顏色
- 27. TodayExtension背景顏色
- 28. ItemControl背景顏色
- 29. QSciScintilla背景顏色
- 30. JQuery背景顏色
透明或黑色的,因爲透明的黑色就沒有意義了:) – ania 2012-08-10 12:19:51
其實我需要光黑如對話框盒子背景這可能嗎? – dilaraates 2012-08-10 12:21:05
您可以參考此鏈接Transparent此鏈接對您有所幫助。 – 2012-08-10 12:22:26