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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:41:28+00:00 2026-05-25T02:41:28+00:00

I am using a tab widget to simulate the menus in the iphone. Here

  • 0

I am using a tab widget to simulate the menus in the iphone. Here is a picture of my screen enter image description here

As you can see the words don’t fit within the individual boxes. How can I make the text size smaller for each widget? Also Is there a way to scale down the pictures inside the tabs so they don’t look so crammed? So far the icons all “fit to size” so it tries to occupy as much space as possible.

Thanks for the help, see below for my code on the tabs

@Override
public void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    setContentView(R.layout.tab_layout);
    Resources res = getResources(); // Resource object to get Drawables
    TabHost tabHost = getTabHost(); // The activity TabHost
    TabHost.TabSpec spec; // Resusable TabSpec for each tab
    Intent intent; // Reusable Intent for each tab

    intent = new Intent().setClass(this, ImTracking.class);
    spec = tabHost
            .newTabSpec("imtracking")
            .setIndicator("I\'m Tracking",
                    res.getDrawable(R.drawable.mapbutton))
            .setContent(intent);
    tabHost.addTab(spec);
    intent = new Intent().setClass(this, TrackingMe.class);
    spec = tabHost
            .newTabSpec("trackingme")
            .setIndicator("Tracking Me",
                    res.getDrawable(R.drawable.friends)).setContent(intent);
    tabHost.addTab(spec);
    intent = new Intent().setClass(this, Settings.class);
    spec = tabHost
            .newTabSpec("settings")
            .setIndicator("Settings",
                    res.getDrawable(R.drawable.settingsicon))
            .setContent(intent);
    tabHost.addTab(spec);
    intent = new Intent().setClass(this, Review.class);
    spec = tabHost.newTabSpec("review")
            .setIndicator("Review", res.getDrawable(R.drawable.like))
            .setContent(intent);
    tabHost.addTab(spec);
    intent = new Intent().setClass(this, help.class);
    spec = tabHost.newTabSpec("help")
            .setIndicator("Help", res.getDrawable(R.drawable.help))
            .setContent(intent);
    tabHost.addTab(spec);
    tabHost.setCurrentTab(0);

EDIT
here is the xml
tab_layout.xml

<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"
        android:padding="0dp">

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="0dp"
            android:layout_weight="1"/>

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0"/>

    </LinearLayout>

</TabHost>

tab.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center"
android:orientation="vertical" android:padding="0dp">
<ImageView android:id="@+id/tab_icon" android:layout_width="30dp"
    android:layout_height="30dp" android:scaleType="fitCenter" />
<TextView android:id="@+id/tab_text" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:singleLine="true"
    android:textStyle="bold" android:gravity="center_horizontal"
    android:textSize="10sp" android:padding="3dip" android:ellipsize="marquee"
     />
</LinearLayout>
  • 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-25T02:41:29+00:00Added an answer on May 25, 2026 at 2:41 am

    You could use this implementation of a TabWidget, its custom tabs! You can edit the Layout and Views associated with these custom tabs easily.

    Be warned, these tabs don’t use the system background for the tab colour when selected / not selected and use the grey look you see in the image below.

    http://code.google.com/p/android-custom-tabs/

    Android custom tabs

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

Sidebar

Related Questions

In a TabHost widget, I can create a new tab with its content (Intent)
I'm using a dynamic jQuery tab widget to add/remove tabs generated programmatically. How do
Using the Eclipse SWT StyledText widget, how can you indent/un-indent a selected block of
I am using tabwidget when i apply white theme on tab widget selected tab
i am using tab bar control in my app and want to use the
I am using a tab bar (UITabBarController) on my app and I wish to
I am using Ajax tab container control with 3 tabs. I have placed a
I want to create a tab using child tab having intents, so that when
I'm trying to launch a website url in a new tab using python in
So, the goal is to confirm switching to another UI tab using UI Dialog

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.