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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:13:25+00:00 2026-05-26T01:13:25+00:00

I’m using a TabLayout and I have custom images for the tabs that I

  • 0

I’m using a TabLayout and I have custom images for the tabs that I am using, but for the life of me I can’t figure out how to change the color or even the image of the divider between the tabs and the tab content. I have attempted to use setDividerDrawable(), but it crashes when I call it before setting the tab content and just does nothing when I call it after. If I can just get it to be black that would be sufficient, but so far nothing has worked. Thanks for any guidance.

  • 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-26T01:13:25+00:00Added an answer on May 26, 2026 at 1:13 am

    You have to do this:
    tabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);

    Where R.drawable.tab_divider is an image in your resources directory.

    But the key is you have to do that BEFORE you’ve added any tabs to the tab host.

    My tab initialization code looks like:

    private void initializeTabs(int curTab) {
        this.tabHost = getTabHost();
        tabHost.clearAllTabs();
    
        TabSpec ts1, ts2, ts3, ts4, ts5;
        // tab separator
        tabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);
    
        ts1 = this.setupTab(new TextView(this), tabHost, R.drawable.browse_tab_normal, 
                mResources.getString(R.string.Browse));
    
        ts2 = this.setupTab(new TextView(this), tabHost, R.drawable.search_tab_normal, 
                mResources.getString(R.string.Search));
    
        ts3 = this.setupTab(new TextView(this), tabHost, R.drawable.postad_tab_normal, 
                mResources.getString(R.string.Post));
    
        ts4 = this.setupTab(new TextView(this), tabHost, R.drawable.watchlist_tab_normal, 
                mResources.getString(R.string.WatchList));
    
        ts5 = this.setupTab(new TextView(this), tabHost, R.drawable.managead_tab_normal, 
                mResources.getString(R.string.Login));
    
        // intents
        ts1.setContent(new Intent().setClass(this, BrowseTabActivity.class));
        ts2.setContent(new Intent().setClass(this, SearchTabActivity.class));
        ts3.setContent(new Intent().setClass(this, PostAdTabActivity.class));
        ts4.setContent(new Intent().setClass(this, WatchlistTabActivity.class));
        ts5.setContent(new Intent().setClass(this, LoginTabActivity.class));
    
        tabHost.addTab(ts1);
        tabHost.addTab(ts2);
        tabHost.addTab(ts3);
        tabHost.addTab(ts4);
        tabHost.addTab(ts5);
    

    …

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a French site that I want to parse, but am running into
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but

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.