我在我自己的布局中包含一个(内部)布局,如下所示:
<include android:id="@+id/twolinelistitem"
layout="@android:layout/simple_list_item_2"
style="@style/TwoLineListItem"/>
Run Code Online (Sandbox Code Playgroud)
但风格不适用.这篇博文没有提到这应该有用,所以如果没有,我也没关系.
所以设置即背景的唯一方法是以编程方式?
这是一个有点相关的android问题
如何include在Android中的标签上设置背景颜色?这不起作用:
<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%"/>
Run Code Online (Sandbox Code Playgroud)