How to set background color on an include
tag in Android? This does not work:
<include
android:id="@+id/list_item_section_text"
android:layout_width="fill_parent"
android:layout_height="match_parent"
layout="@android:layout/preference_category"
android:background="%MY_BACKGROUND%"/>
If you are not "too-deep-view-tree-paranoia" type of guy, you can wrap your include
in FrameLayout
:
<FrameLayout
android:id="@+id/list_item_section_text"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="%YOUR_BACKGROUND%">
<include layout="@android:layout/preference_category"/>
</FrameLayout>
EDIT: Of course, don't forget to remove android:background
from your preference_category.xml
layout first.
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