1

I have a simple demo app with just one listActivity and I'm using actionBarSherlock.

My styles.xml is:

<resources>

    <style name="AppBaseTheme" parent="Theme.Sherlock"></style>

    <style name="AppTheme" parent="AppBaseTheme">
        <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item>
        <item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item>
        <item name="android:windowBackground">@android:color/white</item>
    </style>

    <style name="Widget.MyTheme.ActionBar" parent="Widget.Sherlock.ActionBar">
        <item name="android:background">#388E8E</item>
        <item name="background">#388E8E</item>
    </style>

</resources>

This style gives me a blue actionbar in 2.x and 3.x with white text in the action bar and a white background on my activity. Looks perfect on Android 2.x and 4.x. The problem is that in 2.x when I scroll, I get a black background. I'm currently using a SimpleAdapter:

int[] ids = { android.R.id.text1, android.R.id.text2 };
SimpleAdapter adapter = new SimpleAdapter(this, aList, android.R.layout.simple_list_item_2, from, ids);

Any ideas on how to stop this from happening?

1

1 Answer 1

2

Hi @EGHDK it is your list page problem. append android:cacheColorHint="#00000000" in your listView node. example <ListView android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" android:background="@color/somecolor" android:divider="@android:color/transparent" android:cacheColorHint="#00000000" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.