Android 列表视图变灰了

Android 列表视图变灰了,android,listview,textview,fragment,Android,Listview,Textview,Fragment,所以我在这里遇到了一个非常奇怪的问题。我正在使用一个具有框架布局的导航抽屉来切换内容。我目前有两个片段建立,一个是刚刚好,它唯一的东西是一个按钮,没有指定布局。不过,我的第二个片段有一个相对布局,其中有一个textview和一个listview 当我加载使用textview的listview时,我得到以下结果: 如您所见,listview显示为灰色。我没有在我的布局中为这个设置即时颜色,所以它不是所有的灰色文本,我仍然可以单击每个项目并滚动列表。我不知道这是什么原因,有什么提示吗 编辑以下是我

所以我在这里遇到了一个非常奇怪的问题。我正在使用一个具有框架布局的导航抽屉来切换内容。我目前有两个片段建立,一个是刚刚好,它唯一的东西是一个按钮,没有指定布局。不过,我的第二个片段有一个相对布局,其中有一个textview和一个listview

当我加载使用textview的listview时,我得到以下结果:

如您所见,listview显示为灰色。我没有在我的布局中为这个设置即时颜色,所以它不是所有的灰色文本,我仍然可以单击每个项目并滚动列表。我不知道这是什么原因,有什么提示吗

编辑以下是我正在使用布局的代码片段:

View rootView = inflater.inflate(R.layout.fragment_read_it, container,
            false);
这是我的布局:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >

<TextView
      android:id="@+id/info"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" />
<ListView
      android:id="@+id/listView"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" /> 

</RelativeLayout>
最后是我的改编和列表:

ArrayAdapter<PressRelease> adapter = new ArrayAdapter<PressRelease>(
            getActivity().getApplicationContext(),
            android.R.layout.simple_list_item_1, pressReleases);

listView.setAdapter(adapter);

请为textview指定特定颜色,如

<TextView
android:width="match_parent"
android:height="wrap_content"
android:textColor="#000000"
>
在列表视图中,将缓存颜色提示设置为透明

<ListView
android:width="match_parent"
android:height="wrap_content"
android:cacheColorHint="@andorid:color/transparent"
>

我在另一个线程中找到了解决方案。


我将getApplicationContext与适配器一起使用,出于某种原因,将其与灯光主题一起使用会使listview上的颜色变亮

请告诉我们布局和添加方式。更新如果我给我的listview添加深色,可以,文本变为白色,但是如果不这样,我的listview看起来是一样的:白色,文本变为灰色。如果我使用cacheColorHint,并实际添加颜色,它将在我滚动时变为该颜色,但在其他方面还是一样的。