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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:02:25+00:00 2026-06-09T19:02:25+00:00

I have a tab host in which i have more than 6 buttons. However

  • 0

I have a tab host in which i have more than 6 buttons. However the screen shows only 3-4 buttons.

Following is the code which i am using along with the image.

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#777777">

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"

        >
       <RelativeLayout
            android:id="@+id/layTab"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:background="@drawable/navbar_background"
            android:layout_alignParentBottom="true"
            android:layout_centerVertical="true"
            >
            <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            />
        </RelativeLayout>
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_alignParentTop="true"
            android:layout_above="@+id/layTab"/>


   </RelativeLayout>
</TabHost>

enter image description here

The question is, How am i suppose to add a scroll so that i can scroll upto all 6 buttons or any other trick.

Best Regards

  • 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-09T19:02:29+00:00Added an answer on June 9, 2026 at 7:02 pm

    Just nest the TabWidget inside a HorizontalScrollingView, like this:

    <?xml version="1.0" encoding="utf-8"?>
    <TabHost xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#777777" >
    
        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >
    
            <RelativeLayout
                android:id="@+id/layTab"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_centerVertical="true"
                android:background="@drawable/navbar_background"
                android:gravity="center"
                android:paddingLeft="10dp"
                android:paddingRight="10dp" >
    
                <HorizontalScrollView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:fillViewport="true"
                    android:scrollbars="none" >
    
                    <TabWidget
                        android:id="@android:id/tabs"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" >
                    </TabWidget>
                </HorizontalScrollView>
            </RelativeLayout>
    
            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_above="@+id/layTab"
                android:layout_alignParentTop="true" />
        </RelativeLayout>
    
    </TabHost>
    

    By the way, this solution works for many other scenarios, RadioGroup, for example

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

Sidebar

Related Questions

I have an app using a tab bar host api that I found and
I have a view with TabHost and TabWidget which host on every tab a
I have a Tabhost which is my main activity. When a tab is clicked
I have tab controller created through storyboards with a custom implementation (simple buttons and
I have an application which I am developing using WPF\Prism\MVVM. All is going well
For example, i have 3 activities.. I also use Tab host with separate activity
I have written a sidebar gadget which displays a series of links using silverlight.
Today I have just thrown together this PowerShell script which takes a tab-delimited text
Ok, so I have a Android 3.1 tablet (Acer Iconia Tab, which is great
I have the following javascript bookmarklet which opens a new popup window with a

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.