如何设置expandablelistView的所有子视图的背景?

时间:2012-07-10 05:51:07

标签: android expandablelistview

我想在不更改groupview的情况下设置expandablelistView的背景。 设置每个子项的背景不符合要求。我认为,expandablelistView的childView在某种程度上就像listview一样,必须有一个地方设置它的背景,而不必逐项设置。你的善意回应我会非常感激!感谢。

2 个答案:

答案 0 :(得分:0)

在子视图布局(child_.xml)中放入主布局背景属性。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

</LinearLayout>

它只会改变子视图的背景。

答案 1 :(得分:0)

将背景设置为必须在适配器中充气的布局/子项,而不是父布局。

相关问题