android.R.color.transparent not fully transparent

前端 未结 5 1236
忘掉有多难
忘掉有多难 2020-12-17 20:40

In my application, I apply the transparent background to my ListView\'s CustomListItem at runtime. For that I use, convertView.setBackgroundColor(android.

5条回答
  •  隐瞒了意图╮
    2020-12-17 21:11

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

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

提交回复
热议问题