Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8075445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:59:15+00:00 2026-06-05T14:59:15+00:00

I have a listview with a layout which has an nested layout with a

  • 0

I have a listview with a layout which has an nested layout with a different background color to the main layout.

Inside this nested layout is an imageview. Whenever images are loaded into the view the background color of this nested layout disappears. The background does not come back until the listview is scrolled.

Also when scrolling the listview has the images in the imageview are drawn again this sequence happens again which gives the list a flickering effect.

I have tried setting cacheColorHint property on both the main layout and nested layout but it does not seem to change.

Here is an example image of what the happens when loading the images/scrolling. As you can see the background color for the two items at the bottom has disappeared and the rest still have their background color.

enter image description here

Here is the part of the listview layout with the nested layout.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/race_entrant"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingTop="2dip"
android:paddingBottom="2dip"
android:paddingRight="2dip"
android:orientation="horizontal"
android:descendantFocusability="blocksDescendants"
android:cacheColorHint="#E0EAF1">
<LinearLayout
    android:layout_height="fill_parent"
    android:layout_width="50dip"
    android:orientation="vertical"
    android:id="@+id/linearLeft"
    android:paddingLeft="2dip"
    android:paddingRight="2dip"
    android:paddingTop="2dip"
    android:paddingBottom="2dip"
    android:background="#E0EAF1"
    android:cacheColorHint="#E0EAF1">
    <TextView
        android:id="@+id/txtEntrantNo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="@style/entrant_number"
        android:layout_gravity="center_horizontal"
        android:cacheColorHint="#E0EAF1" />
        <ImageView
            android:id="@+id/imgJockey"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="1dip"
            android:adjustViewBounds="true"
            android:cacheColorHint="#E0EAF1" />
</LinearLayout>

How can I stop the background color of the nested layout from disappearing like this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:59:17+00:00Added an answer on June 5, 2026 at 2:59 pm

    I managed to get this to work by setting the background color of the imageview.

    The xml to do this was:

    android:background="#E0EAF1"
    

    Now when the images are loaded the background color does not change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have an android application which has a listview for listing 14 items inside
I have a ListView in which each item has a complex layout that contains,
I have a layout which has an adview under an imageview.In some conditions i
I have an xml layout which I use for each row in my listview:
I have a listView, where each row has a button in the row layout.
enter code here I have a ListView that have a different Layout XML for
I have ListView in my project which has ListItems as in the form of
I'm working on a project that has an ExpandableListView nested inside a regular ListView
I have a ListView in which each item has a SeekBar. When I update
I have a XML layout which has two edit text fields, one for title

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.