android.R.color.transparent不完全透明 [英] android.R.color.transparent not fully transparent

查看:2575
本文介绍了android.R.color.transparent不完全透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我申请了透明背景,我的的ListView 的CustomListItem在运行时。为此,我使用, convertView.setBackgroundColor(android.R.color.transparent); 。它的工作原理和显示透明度。但事实并非完全透明的,因为有某种色光的背景。我也试图把我自己的透明色的值#80000000 #00000000 但结果却是雪上加霜。我能做些什么,以获得完全透明的颜色?

In my application, I apply the transparent background to my ListView's CustomListItem at runtime. For that I use, convertView.setBackgroundColor(android.R.color.transparent);. It works and shows transparency. But that is not fully transparent as there is some kind of shade to the background. I also tried putting my own transparent color with the values #80000000 and #00000000 but the result is worse. What can I do to get the fully transparent color?

推荐答案

android.R.color.transparent 是一个资源ID(指的是透明色的定义) - View.setBackgroundColor(INT)预计实际INT的颜色。

android.R.color.transparent is a resource id (referring to a transparent color definition) - View.setBackgroundColor(int) expects an actual int color.

使用<一个href="http://developer.android.com/reference/android/view/View.html#setBackgroundResource%28int%29">View.setBackgroundResource(int)相反,这将加载实际的颜色从资源。

Use View.setBackgroundResource(int) instead, which will load the actual color from resources.

这篇关于android.R.color.transparent不完全透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆