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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:21:32+00:00 2026-06-14T23:21:32+00:00

I have a number of elements in a ListView that scroll off the screen.

  • 0

I have a number of elements in a ListView that scroll off the screen.

I would like there to be blank space at the end of the View. That is, the user should be able to scroll past the last element such that the last element is in the middle of the viewport.

I could use an OverScroller, but I think that would only enable the View to have a bouncy effect like one often sees on the iPhone.

Is there something I might have overlooked?

The scrolled-to-the-botton screen should look something like this:
Android mockup where there are a number of labels the last of which is near the middle of the screen

  • 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-14T23:21:33+00:00Added an answer on June 14, 2026 at 11:21 pm
    1. Inflate any layout of your choice (this could be an XML of and ImageView with no drawable and with set height and width of your choice)
    2. Measure the screen height and create new LayoutParams and set the height of it to 1/2 of the screen height
    3. Set the new layout params on your inflated view
    4. Use the ListView’s addFooterView() method to add that view to the bottom of your list (there is also an addHeaderView())

    Code to measure screen height

     WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
     Display display = wm.getDefaultDisplay();
     int screenHeight = display.getHeight();
    

    Code to set half screen height:

     View layout = inflater.inflate(R.layout.mylistviewfooter, container, false);
     ViewGroup.LayoutParams lp = layout.getLayoutParams();
     lp.height = screenHeight/2;
     layout.setLayoutParams(lp);
     myListView.addFooterView(layout);
    

    An Aside:
    When you add a footer or header view to any listview, it has to be done before adding the adapter. Also, if you need to get your adapter class after doing this you will need to know calling the listview’s adapter by getAdapter() will return an instance of HeaderViewListAdapter in which you will need to call its getWrappedAdapter method
    Something like this :

     MyAdapterClassInstance myAdapter = (MyAdapterClassInstance) ((HeaderViewListAdapter) myListView.getAdapter()).getWrappedAdapter();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jlist with an arbitrary number of elements. I would like to
I have a number of elements on the screen that I need to cover
I have a number of elements on a web page, that are scattered, meaning
I have a number of message elements that come in pairs: If element A1
I have n number of select elements in an html page that are used
I have a number of text input elements that when its values are changed,
I have a TABLE elements with one COLUMN number, type SMALLINT that contains numbers
I have a number of elements that i want to loop through as groups.
I have number of checkbox elements are there in my html page <input type='checkbox'
Suppose I have a number of elements to store like: fruitList = apple, orange,

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.