0

So I've run into a pretty peculiar issue here. I am using a navigation drawer that has the framelayout to switch out content. I current have two fragments built, one is just fine and the only thing it has in it is a button, no layout specified. My second fragment though has a relative layout with a textview and a listview.

When I load the listview (which uses the textview) I get this:

enter image description here

As you can see, the listview is greyed out. I have no immediate colors set in my layout for this so it's not all grey text, and I can still click each item and scroll the list. I have no idea what is causing this, any tips?

EDIT Here are snippets of my code where I am working with the layout:

View rootView = inflater.inflate(R.layout.fragment_read_it, container,
            false);

And here is my layout:

<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>

And lastly my adapt and list:

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

listView.setAdapter(adapter);
DeveryDay
  • 161
  • 15
  • Can you show us the layout and the way you are adding it please. – meir shapiro Mar 03 '14 at 17:08
  • **UPDATE** If I give my listview a dark color, it's fine and the text turns white, but without that my listview looks the same: white with greyed out looking text. – DeveryDay Mar 03 '14 at 17:38

2 Answers2

0

Please give specific color to textview like

<TextView
android:width="match_parent"
android:height="wrap_content"
android:textColor="#000000"
>

And in list view put cache color hint as transparent like

<ListView
android:width="match_parent"
android:height="wrap_content"
android:cacheColorHint="@andorid:color/transparent"
>
Amarjit
  • 4,327
  • 2
  • 34
  • 51
  • If I use the cacheColorHint, and actually add a color it will turn that color as I scroll, but it's still the same otherwise. – DeveryDay Mar 03 '14 at 17:23
0

I found a solution in another thread. Use android.R.layout.simple_list_item_1 with a light theme

I was using getApplicationContext() with my adapter, and for some reason using this with the light theme makes the colors on the listview light.

Community
  • 1
  • 1
DeveryDay
  • 161
  • 15