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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:55:13+00:00 2026-05-26T09:55:13+00:00

I am developing a sample application with TabHost , which is containing HorizontalScrollView .

  • 0

I am developing a sample application with TabHost, which is containing HorizontalScrollView. Here is my problem:

  • I have more than 10 tabs, when i click on any of the tabs it should set the gravity as center? How i can over come this issue.

Thanks in advance!!!

  • 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-26T09:55:14+00:00Added an answer on May 26, 2026 at 9:55 am

    This will involve some calculation.

    Bsically you will need to scroll to the position to center a element.

    int scrollX = (button.getLeft() - (screenWidth/2))+(button.getWidth()/2);
    hScrollView.scrollTo(scrollX,0);
    

    Where the

    button -> It is the button you are trying to center.
    
    screenWidth -> Width of the screen.
    int screenWidth = getWindowManager().getDefaultDisplay().getWidth();
    
    hScrollView -> It is the horizontal scrollview.
    

    But even with this method, you will not be able to center the end elements as scrollviews will not scroll beyond its bounds.

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

Sidebar

Related Questions

I am developing a sample application to call .Net web services. I have added
Any good source/website/inputs/sample to kickstart developing a twitter application using twitter API? Edit :
I'm developing an application which has a Settings pane, following the AppPrefs sample by
I am developing a sample application, where I have a situation for moving a
I am developing one android application in which i have implemented the 10 ads
Hi I am developing a simple application based upon ASP.NET MVC. I have altered
I am developing a simple application which has to send an SMS message from
Here's the situation: I'm developing a simple application with the following structure: FormMain (startup
I have a simple application using netbeans for developing and maven for building et
Im developing the java Email application with Timer, I have a two arraylists named

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.