Question

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

No correct solution

OTHER TIPS

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top