私のアプリケーションでは、実行時にListView
のCustomListItemに透明な背景を適用します。そのため私はconvertView.setBackgroundColor(android.R.color.transparent);
を使います。それは働き、透明性を示します。しかし、それはバックグラウンドに何らかの影があるので、完全に透明ではありません。私はまた、#80000000
と#00000000
の値を持つ私自身の透明な色を入れてみましたが、結果は悪いです。完全に透明な色を得るために私は何ができますか?android.R.color.transparent not fully transparent
答えて
android.R.color.transparent
は、リソースIDです(透過色定義を参照しています)。View.setBackgroundColor(int)
は、実際のint色を予期しています。
代わりにView.setBackgroundResource(int)を使用してください。リソースから実際の色が読み込まれます。
してみてください。xmlファイルであなたのリストビューに、この属性を設定し
convertView.setBackgroundColor(Color.argb(0, 0, 0, 0));
android:background="@android:color/transparent"
も実行時にリストビューのCustomListItemに透明な背景を適用します。そのために あなたはあなたの意見に透明性が必要な場合
convertView.setBackgroundColor(Color.TRANSPARENT);
おかげ
人はいません。私の質問を読んでください。 'convertView.setBackgroundColor(android.R.color.transparent);'は動作しませんでした。 @antonyt答えを読む。出来た。 – Rajkiran
私は編集の回答を持っていますこれをチェックしてください –
convertView.setBackgroundColor(Color.argb(0, 0, 0, 0));
OR
convertView.setBackgroundColor(Color.parseColor("#00000000"));
があなたのXMLのファイルで、今からこれを使用し、使用を持っている:
android:background="@null"
あなたはより良いパフォーマンスを得るつもりです。
- 1. UIImage Not Transparent
- 2. QQuickWindow transparent
- 3. sIFR 3:Background Transparent?
- 4. Monodroid Transparent WebView
- 5. NSTableView transparent TableView
- 6. Ardor3D transparent quad
- 7. c#:transparent in tabControl
- 8. Boostrap navbar-default transparent
- 9. Three.js transparent/disparition
- 10. jQuery PNG transparent MouseHover
- 11. iOS 5 black transparent UIAlertView
- 12. NSOutlineView with transparent field editor
- 13. JLabel over transparent painted Rectangle?
- 14. IE 7 transparent PNG problem
- 15. firefox addon、transparent floatingパネル
- 16. XAML for Rotating、Round Image、Transparent Center
- 17. IE7 IE8 IE9色:transparentプロパティ
- 18. jQuery Mobile、transparent black overlay effect
- 19. Modrewrite transparent書き換え
- 20. SWFObject Flash Playerスクリプト:Wode = Transparent?
- 21. Flash wmode transparent - 後ろをクリック
- 22. PHPのimagecolort transparentが動作しない
- 23. android:drawable/btn_default transparentの作成方法
- 24. :not not working
- 25. AS3:is not not keyword?
- 26. md-toolbar background-color:transparent not working
- 27. ExternalInterface.callback not working
- 28. MySQLのNOT INとNOT
- 29. SQL/MySQL NOT NULLとNOT EMPTY
- 30. NOT EXISTS NOT NOISISとNOTの違いについての質問
恐ろしい男。すばらしいです。ありがとう。出来た。 – Rajkiran
が働いていますが、なぜそれが明らかでないのは依然として謎です。 – halxinate