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

  • SEARCH
  • Home
  • 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 7794539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:48:21+00:00 2026-06-01T22:48:21+00:00

I have the default list view as with the black background, I would like

  • 0

I have the default list view as with the black background, I would like to have it like this:

enter image description here

or:

enter image description here

How do I achieve 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-01T22:48:23+00:00Added an answer on June 1, 2026 at 10:48 pm

    If you using array adapter you should create two layouts. In one of them to define view of listview element, another must contain <listview> tag.

    In onCreate:

    public class ListAction extends Activity {
        private ListView lv1;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.list);
    
            lv1 = (ListView) findViewById(R.id.listView);
    
                ArrayAdapter<CharSequence> adapter = ArrayAdapter
                        .createFromResource(this, some array,
                                R.layout.list_items);
                lv1.setAdapter(adapter);
                cats = getResources().getStringArray(some array);
    
            lv1.setTextFilterEnabled(true);
            lv1.setOnItemClickListener(new OnItemClickListener() {
                public void onItemClick(AdapterView<?> a, View v, int position,
                        long id) {
    
                }
            });
        }
    }
    

    You shold use R.array.<name> instead of some array

    Example of list_item.xml:

        <?xml version="1.0" encoding="utf-8"?>
        <TextView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@android:id/text1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:paddingBottom="8.0dip"
            android:paddingLeft="12.0dip"
            android:paddingRight="3.0dip"
            android:paddingTop="8.0dip"
            android:textColor="#ffffffff"
            android:textSize="10.0pt"
            android:textStyle="italic"
            android:background="@drawable/list_bg"
            android:text="List Item" />
    

    Example of list.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        android:background="@color/white" >
    
        <ListView
            android:id="@+id/listView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:divider="@drawable/divider" />
    
    </LinearLayout>
    

    For more specific layout you can look at this link http://www.ezzylearning.com/tutorial.aspx?tid=1763429&q=customizing-android-listview-items-with-custom-arrayadapter


    Added:
    At first you can change background for entire layout in list.xml, also you can use custom divider (You should use tag divider as above).

    You can’t add another layouts into list_item.xml, but you can use android:background to set item background. I never used that but I know it works. For more changes you should use simplearray or write your own adapter.

    Example how to use gradient (I’m using it for buttons):

    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle" >
        <corners android:radius="12px" />
        <gradient
            android:angle="90"
            android:endColor="#color2"
            android:startColor="#color1"
            android:type="linear" />
    </shape>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a default.aspx page like this with the goal of redirecting differently based
I have a list view that is displaying data using the gridview. This list
I have some questions about the default values in a function parameter list Is
So I have a selection list, and if the default value hasn't been changed
I want to be able to have default text like Enter content here... appear
In SharePoint I am using the default view of a list. When I use
I am using asp.net mvc 2.0(default binding model) and I have this problem. I
In a ASP.NET MVC 4 app I have a view with a paged list
I have a ListView containing some ListViewItems. By default, selecting items makes their background
Hi I have created Expandible list view using BaseExpandableListAdapter. If i scroll the list

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.