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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:10:31+00:00 2026-06-12T00:10:31+00:00

To increase the listview height, I am using exbandable ListView as, public class ExpandableListView

  • 0

To increase the listview height, I am using exbandable ListView as,

public class ExpandableListView extends ListView {

    private android.view.ViewGroup.LayoutParams params;
    private int old_count = 0;

    public ExpandableListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        if (getCount() != old_count) {
            old_count = getCount();
            params = getLayoutParams();
            params.height = getCount() * (old_count > 0 ? getChildAt(0).getHeight() : 0);
            System.out.println("params h "+params.height+" "+params);
            setLayoutParams(params);
        }

        super.onDraw(canvas);
    }

}

layout.xml as,

<com.jems.realtimedata.ExpandableListView
                android:id="@+id/listView1"
                android:layout_width="match_parent"
                android:layout_height="match_parent"      
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="25dp"
                android:background="@color/list_back"
                android:cacheColorHint="#00000000"
                android:divider="@drawable/line"
                android:paddingLeft="7dp"
                android:paddingRight="7dp"
                android:paddingTop="10dp"
                android:scrollbars="none" />

But,last item of list not displaying properly. I used utility class also,but no change in list.Any other solution to extend the view.Please help me to solve this issues.

  • 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-12T00:10:32+00:00Added an answer on June 12, 2026 at 12:10 am

    This question is already posted.So have a look at this, and you can customize it according to your need in Expandable list

    This link will help you:

    How to change ListView height dynamically in Android?

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

Sidebar

Related Questions

I want to increase the height of a row in listview when it is
How can I increase django execution time of a view. Some views of my
I have an android-app with a listview in an activity. The listview has, if
I have got a StartCommand Class: public class StartCommand : ICommand { public void
I want to increase the line separator height between li tags. I have tried
I have a ListView where each objects in the list has the parameter: android:layout_height=wrap_content
In Listview, if I want to use the paging feature, how can i increase
How to increase buffer size in Oracle SQL Developer to view all records (there
Is there anyway to increase Canvas size more then my screen size in Android?
I have a list view in android. And in each list item, user can

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.