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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:32:40+00:00 2026-05-26T08:32:40+00:00

<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> <LinearLayout android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent> <TabWidget android:id=@android:id/tabs android:layout_width=fill_parent android:layout_height=wrap_content />

  • 0
<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">
<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />
    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    </FrameLayout>
</LinearLayout>

This is my layout, then in my activity which extends TabActivity I add the five different tabs like this:

    mTabHost = getTabHost();
    mTabHost.addTab(mTabHost.newTabSpec("tab1").setIndicator("tab1").setContent(new Intent().setClass(this, Activity1.class).putExtra("language", language)));
    mTabHost.addTab(mTabHost.newTabSpec("tab2").setIndicator("tab2").setContent(new Intent().setClass(this, Activity2.class).putExtra("language", language)));
    mTabHost.addTab(mTabHost.newTabSpec("tab3").setIndicator("tab3").setContent(new Intent().setClass(this, Activity3.class).putExtra("language", language)));
    mTabHost.addTab(mTabHost.newTabSpec("tab4").setIndicator("tab4").setContent(new Intent().setClass(this, Activity4.class).putExtra("language", language)));
    mTabHost.addTab(mTabHost.newTabSpec("tab5").setIndicator("tab5").setContent(new Intent().setClass(this, Activity5.class).putExtra("language", language)));

The problem I have is that all the five tabs are put in one row, but I want to put the three first tabs on top and then the two other tabs below the three first. How can I achieve this?

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-26T08:32:40+00:00Added an answer on May 26, 2026 at 8:32 am

    If you are just trying to arrange your tabs(if all 5 are not displaying properly),any this is the only single reason to do as you asked (at top 3tabs and below 2 tabs), then you have better solution to put your TabView in ScrollView.

    For example :

    <?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">
      <LinearLayout android:orientation="vertical"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent">
        <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="fill_parent"
                     android:layout_height="wrap_content"/>
        </HorizontalScrollView>
        <FrameLayout android:id="@android:id/tabcontent"
                     android:layout_width="fill_parent"
                     android:layout_height="fill_parent" />
      </LinearLayout>
    </TabHost>
    

    Refrence : Scrolling Tabs in Android

    Hope you are looking for the same.

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

Sidebar

Related Questions

Have the following view in my app: <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> <LinearLayout android:orientation=vertical
I've a TabHost like this: <?xml version=1.0 encoding=utf-8?> <TabHost xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:id=@android:id/tabhost android:background=@drawable/tabs_bg>
I have a layout which inludes actionbar and tabs: <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>
I have the following application.xml <?xml version=1.0 encoding=utf-8?> <manifest xmlns:android=http://schemas.android.com/apk/res/android package=com.currency.mobile.android> <uses-permission android:name=android.permission.INTERNET/> <application
I have this layout file in my android application: <?xml version=1.0 encoding=utf-8?> <TabHost xmlns:android=http://schemas.android.com/apk/res/android
i'm trying to use TabHost and TabWidget in my Android application. This is my
I have an Android application that is a TabHost with a WebView. I use
In my Android app I use a TabWidget without any special customization. I'd like
public class SoapBox extends TabActivity{ private TabHost tabHost; private void setupTabhost() { tabHost=(TabHost)findViewById(android.R.id.tabhost); tabHost.setup();
package com.example.helloandroid; import java.util.ArrayList; import java.util.Arrays; import android.app.TabActivity; import android.os.Bundle; import android.view.Window; import android.widget.ArrayAdapter;

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.