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 6789427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:36:10+00:00 2026-05-26T17:36:10+00:00

I have a ListView with a custom view rendered by an adapter. It contains

  • 0

I have a ListView with a custom view rendered by an adapter. It contains an image, some text and another ListView. In the getView method of adapter I creator another adapter to set up the embedded ListView.

It all works fine, but for some reason the height of the embedded ListView is only enough to view one list item. If I manually set the height to pixels I can see more items in the list. All heights are set to wrap_content so I’m not sure why it’s not working.

My first ListView looks like this:

<ListView
    android:id="@+id/newswire"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:cacheColorHint="#ffffff"
/>

The item that gets rendered for this ListView:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:padding="5dp"
  >

      <ImageView
          android:id="@+id/aggSparkAvatar"
          android:layout_width="45dp"
          android:layout_height="45dp"
          android:scaleType="centerCrop"
      />

    <LinearLayout
        android:orientation="vertical"
        android:paddingLeft="10dp"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    >

        <TextView
              android:id="@+id/aggSparkName"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:textColor="#1B5F7C"
              android:textStyle="bold"
        />

        <TextView
              android:id="@+id/aggSparkDateStamp"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:textColor="#000000"
              android:textStyle="bold"
        />

        <View
            android:layout_height="1dp"
            android:layout_width="fill_parent"
            android:background="#F2F2F2"            
        />

        <ListView
            android:id="@+id/aggSparkList"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:cacheColorHint="#ffffff"
        />

  </LinearLayout>

</LinearLayout>

Then for the embedded ListView each item looks like this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:padding="5dp"
  >

      <ImageView
          android:id="@+id/sparkAvatar"
          android:layout_width="45dp"
          android:layout_height="45dp"
          android:scaleType="centerCrop"
      />

    <LinearLayout
        android:orientation="vertical"
        android:paddingLeft="10dp"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    >
      <TextView
          android:id="@+id/sparkTitle"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:textColor="#000000"
          android:textStyle="bold"
      />

      <TextView
          android:id="@+id/sparkText"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:textColor="#000000"
      />

      <TextView
          android:id="@+id/sparkDateStamp"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:textColor="#A2A2A2"
      />

  </LinearLayout>

</LinearLayout>
  • 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-05-26T17:36:11+00:00Added an answer on May 26, 2026 at 5:36 pm

    it’s never a good practice to include scrollable views inside another scrollable view. you should consider redesigning your application.

    in your case, the ListView you’re embedding is set to wrap_content, wrap_content – also not a recommended practice. a ListView is designed to show a list of items that collectively will be too big for the screen to show at once. using wrap_content, wrap_content doesn’t make much sense.

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

Sidebar

Related Questions

We have created custom listview by using the Base adapter. List view contains Text
I have a listview with custom array adapter, the view allows the user to
I have a ListView that uses a custom adapter. The custom adapter's getView uses
I have ListView with custom Adapter which supplies View to ListView in this way:
I have a custom list view which contains two text views and on button.
I have got ListView with a custom Adapter. Every row contains clickable buttons and
I have a listview with 200 items. I use a custom view for each
I have a ListView with a custom Adapter that extends ArrayAdapter. It's a ArrayAdapter
I have a Custom ListView that contains a vertical LinearLayout of horizontal LinearLayouts for
I have implemented a custom list view which looks like the twitter timeline. adapter

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.