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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:54:20+00:00 2026-06-17T06:54:20+00:00

I used Horizontal scroll view in which I add ‘Child View’. But on HZ

  • 0

I used Horizontal scroll view in which I add ‘Child View’. But on HZ scroll view I want to arrange child some think like, whole screen will show 3.5 child at a time or 4.5 , 5.5 depends on screen size. The half of child indicate there is more child on Scroller.

For that I used different dimensions for child view depends on density. But still their is some device which show whole child at the end of screen.

So how I can mange this on scroll view. Please guide me in right direction.

enter image description here

  • 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-17T06:54:21+00:00Added an answer on June 17, 2026 at 6:54 am

    For that I used different dimensions for child view depends on
    density. But still their is some device which show whole child at the
    end of screen.

    That will not work well in a lot of devices.
    Assuming that those orange child views are all of the same width(although not that important) and you want to show half of one only when the HorizontallScrollView is first laid out, you could simply post a Runnable(in the onCreate method) on a view to set their widths to a proper dimension so you make the proper appearance:

    public void onCreate(Bundle saved) {
        // ... work   
        horizontalScrollView.post(new Runnable() {
    
                @Override
                public void run() {
                    DisplayMetrics dm = getResources().getDisplayMetrics();
                    int screenWidth = dm.widthPixels;
                    // based on this width, the space between the children and their
                    // widths calculate new widths so you get a half clipped
                    // children on the right side.
                }
            });
    }
    

    But, I would avoid this and simply set a much more powerful indicator on the HorizontalScrollView(overriding its dispatchDraw method and drawing something there(maybe also hiding it a bit later with a Runnable)) if you really want to make sure that the user sees the extra content.

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

Sidebar

Related Questions

I used gallery view in which i place multiple imageview dynamically but on click
I want to print the page (div) if there is no horizontal scroll appear
I am looking to create an effect like that which is used on The
I have some category like shown in fig-1.I have used HorizontalScrollView for category scrolling
I am trying to show horizontal scroll view with images to scroll in two
how do I make a horizontal list view like the one seen in Google
I used the phonegap website to create an IPA file. Now I want to
Can any one give me a example on how to add vertical and horizontal
I just found this ASP.Net server control horizontal scroll not working when align=right attribute
I have a FrameLayout which has a ScrollView as the only child. During runtime

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.