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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:28:00+00:00 2026-05-23T11:28:00+00:00

I have created a tab in my app. Now the thing is that when

  • 0

I have created a tab in my app. Now the thing is that when I set the background color of my tab to white it’s working but only grey color underline still appears so can anyone tell me how can I remove that line?

I am sending my code and snapshot of where the underline arise.

Code for XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="match_parent" 
    android:layout_width="match_parent" 
    android:orientation="horizontal" 
    android:background="#FFFFFF">

    <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="#FFFFFF">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="5dp">
        <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"
            android:padding="5dp"/>
        </LinearLayout>
    </TabHost>
</LinearLayout>

Code for java:

public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Resources res = getResources(); 
    TabHost MainTabHost = getTabHost();  
    TabHost.TabSpec spec; 
    Intent intent; 
    intent = new Intent().setClass(this, ContactListForm.class);

    spec = MainTabHost.newTabSpec("Contacts").setIndicator("Contacts",
                      res.getDrawable(R.drawable.ic_tab_artists))
                  .setContent(intent);
    MainTabHost.addTab(spec);

    intent = new Intent().setClass(this, CallDialerForm.class);
    spec = MainTabHost.newTabSpec("Call").setIndicator("Call",
                      res.getDrawable(R.drawable.ic_tab_artists))
                  .setContent(intent);
    MainTabHost.addTab(spec);

    intent = new Intent().setClass(this, MyInfoForm.class);
    spec = MainTabHost.newTabSpec("My Info").setIndicator("MyInfo",
                      res.getDrawable(R.drawable.ic_tab_artists))
                  .setContent(intent);
    MainTabHost.addTab(spec);

    MainTabHost.setCurrentTab(0);
   for (int j = 0; j < MainTabHost.getTabWidget().getChildCount(); j++) 
    {
        MainTabHost.getTabWidget().getChildAt(j).setBackgroundColor(Color.parseColor("#FFFFFF"));
    }

}

Snapshot:

Snapshot

  • 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-23T11:28:01+00:00Added an answer on May 23, 2026 at 11:28 am

    Use this in your code where you setup tabs. Mind you it is supported only from SDK 8 onwards.

    if(7 < Build.VERSION.SDK_INT){
        tabHost.getTabWidget().setStripEnabled(false);
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created tab app.. now I am playing with screen rotation. I tried
I have created tab style interface using css and javascript with only two tabs
Greetings! I have a working iPhone app (huzzah!) that uses a MainView.xib containing a
So I'm working on an app that has a tab bar for the main
Right now I have an app that allows a user to pick a ring
I have created a tab control and few forms. Each form opens in a
I have created an tab bar application having 3 tab. When I am launching
I have created a Tab Bar Application, removed the default FirstView and SecondView and
I am new to this iphone development.I have created a tab bar application which
I have created a horizontal menu with 5 tab options using a ul and

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.