Im reading about the new Android Lint rules, and I find to prevent overdraw I should make my layouts with a background use a theme with null background, to prevent a background to be drawn if Im just gonna overwrite it. The problem is, how do I define a custom theme with null background?
Fail attempt 1 (doesn't compile):
<style name="NoTitleBarNoBackground" parent="@android:style/Theme.NoTitleBar">
<item name="android:background">null</item>
</style>
Fail attempt 2 (warning persists):
<style name="NoTitleBarNoBackground" parent="@android:style/Theme.NoTitleBar">
<item name="android:background">#00000000</item>
</style>
You can try this:
<style name="CustomTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">@null</item>
</style>
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With