0

我目前正在研究类似“人物”中使用的列表视图的列表视图。我正在使用StickyListHeaders库,但在设置列表标题本身的样式时遇到问题。

目前,这是我的 xml:

<?xml version="1.0" encoding="UTF-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="5dp"
              android:orientation="vertical">

    <TextView
        android:id="@+id/header_text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="15dp"
        android:textColor="@color/ugent_blue_dark"
        android:textSize="15sp"
        android:textStyle="bold" />

    <View
        android:layout_height="1dp"
        android:layout_width="fill_parent"
        android:background="@color/ugent_blue_light">
    </View>

</LinearLayout>

如前所述,我想要实现的是像“人员”视图这样的列表视图。此时,LinearLayout 是透明的。我想通过在 LinearLayout 上使用背景属性来解决这个问题。要与背景“融合”,它必须使用与我正在使用的主题相同的背景。澄清一下:我不希望它变得透明,这就是我尝试应用背景的原因。现在这是我遇到问题的地方:我使用的主题 has as parentTheme.Sherlock.Light有 as parent android:Theme.Light

如果你看截图;您可以看到带有“2 月 12 日”的栏是透明的。我希望它与应用程序的其余部分具有相同的背景。

在此处输入图像描述

所以,我的问题是:background:我需要在 LinearLayout 上应用什么才能使其具有与我的应用程序背景相同的背景?

提前致谢!

4

1 回答 1

0

如果您使用灯光,那么只需将图像设置为灯光!如果 holo 把背景设置为暗。PS我不知道是哪个代码控制了上面的布局主题!使其透明但确定它是否未设置styles然后检查类以查看其是否从那里定制!

于 2013-02-09T20:04:47.200 回答