@null
means no background at all (View.getBackground() returns null).
#00000000
means that you got a ColorDrawable as the background which has a fully-transparent color.
I didn't look at the code, but I guess that the framework tests if the ColorDrawable is fully transparent and does not draw it in this case. Otherwise you would have some drawing overhead, making @null
the faster choice. Both should look identical, so not sure if this is your underlying isse.
To set the equivalent of @null
in code, use View.setBackgroundDrawable(null)
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…