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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:55:34+00:00 2026-05-29T05:55:34+00:00

I have an application where I have 5 tabs set up, and I it

  • 0

I have an application where I have 5 tabs set up, and I it works perfectly except for one issue I noticed recently. On large screen sizes, for some reason, the tabs are transparent, I only noticed this when I tried out the application on one of my colleagues large android device. So I then set up the emulator to a large screen size of 10 inches, and its the same thing.

So in order to fix this, I used this code

    public static void setTabColor(TabHost tabhost) {
    for (int i = 0; i < tabhost.getTabWidget().getChildCount(); i++) {
        tabhost.getTabWidget().getChildAt(i)
                .setBackgroundColor(Color.parseColor("#292929")); // unselected
                                                                    // }
        tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab())
                .setBackgroundColor(Color.parseColor("#8b8b8b")); // selected
    }
}

Then I use OnTabChangeListener and place

setTabColor(tabHost);

under each tab change. This fixed the issue so that the tab colours are the same for all screen sizes. However the problem now is that the divider is gone. I tried using

tabHost.getTabWidget().setDividerDrawable(R.drawable.separator);

but the problem is this piece of code must be called before you set the content of the tabs and seeing I have set up

setTabColor(tabHost);

on every tab change, it makes it rather useless as it works when application loads up, but when you switch tab, it is gone again, and I can’t call it again otherwise application will crash.

Does anyone have any suggestions as to how I can fix this issue? And also could someone explain to me why the tabs are transparent on larger screens? Why does Android do this?

Thanks in advance for any assistance

  • 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-29T05:55:36+00:00Added an answer on May 29, 2026 at 5:55 am

    I fixed this issue, turns out I could just color the tabs in and did not need to use the tab divider after all. Used this method here

        public static void setTabColor(TabHost tabhost) {
        for (int i = 0; i < tabhost.getTabWidget().getChildCount(); i++) {
            tabhost.getTabWidget().getChildAt(i)
                    .setBackgroundColor(Color.parseColor("#292929")); // unselected
                                                                        // }
            tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab())
                    .setBackgroundColor(Color.parseColor("#8b8b8b")); // selected
        }
    }
    

    To color in tabs

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

Sidebar

Related Questions

I have an application made by a UITabBar with three tabs. One of these
I have an application with tabs that are all webviews. I'm using UIWebViewDelegate so
I have an application with multiple documents opened at once (as different tabs), but
I have an iphone application which has about 4 tabs. How do I force
I have a tab bar iPhone application with 4 tabs. In the Interface Builder
I have a WPF application where the entire application functionality is put inside tabs.
I'm developing an iPhone application that have a TabBarController with two tabs. Each tab
I have following problem: I have built a tabbar application with 4 tabs. I
Within my iPhone application I have a common tab bar with three tabs that
I have 4 tabs in my iphone application. When user will click a button

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.