I would like to create a background that contains an image repeating itself horizontally and vertically. Above the entire background I would like to apply a gradient that goes from white to transparent, covering the half of the background.
Now, I would like to know if I can do this with style. It is because I get this warning:
"Possible overdraw: Root element paints background @drawable/background with a
theme that also paints a background (inferred theme is @android:style/Theme)"
It looks like the background is applied twice, once by the default theme (Theme) and then by my layout, drawable element, or whatever.
So, my questions is: how can I do it by creating a new theme or creating a drawable and disable the default Theme background that would be overdrawn by the new one?
Thanks to everyone!
Assuming you want to set the background for all your windows, the style is defined like this:
If you want to do it for a specific view, usually there is an “android:background” attribute that must be set to your drawable.
To have a bitmap with a gradient on top of it, your drawable must be defined using a layer list like this: