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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:48:19+00:00 2026-05-21T06:48:19+00:00

I am using custom background for my Tab layout, but it displaying something different.

  • 0

I am using custom background for my Tab layout, but it displaying something different. As
enter image description here

but I want as

enter image description here

and my code is as

for(int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {
            tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#0079AD"));
            ((TextView) tabHost.getTabWidget().getChildAt(i).findViewById(android.R.id.title)).setTextColor(Color.parseColor("#8CD7F2"));
        }
        tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.parseColor("#009ED6"));

how can I solve this?

  • 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-21T06:48:20+00:00Added an answer on May 21, 2026 at 6:48 am

    For getting effect as I wan’t I am using drawable image as follow and I am getting result as I wan’t almost same as your.

    ImageView view1;
    TabHost tabHost;
    tabHost = getTabHost()
    TabHost.TabSpec spec;
    Intent intent;
    
    view1 = new ImageView(this);
    view1.setOnTouchListener(view1Touch);//for identifying touch newly added.
    view1.setBackgroundResource(R.drawable.tab_image);
    intent = new Intent().setClass(this, AnohterActivity.class);
    spec = tabHost.newTabSpec(TAG_1).setIndicator(view1).setContent(
                    intent);
    tabHost.addTab(spec);
    

    =======================

    OnTouchListener view1Touch = new OnTouchListener() {
    
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_DOWN) {
                v.setBackgroundResource(R.drawable.tab_focus);
            }
    

    }

    and TabChangeListener you might be already added.

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

Sidebar

Related Questions

Background : I am currently using custom controls within my C# project (basic controls
I want to implement a horizontal navbar using a TabLayoutPanel , using custom styling
I'm using a custom layout for an alert dialog, in which I set a
How to Change Listview Color withour using custom listview? In my application the background
I am currently using this code in my App Delegate to set a custom
I've been trying to switch from using PerlSetEnv to using custom configuration directives .
I am creating a installer in .NET and using custom actions for controlling installation.
I'm using a custom-built inhouse application that generates a standard set of reports on
I am using some custom controls one of which is a tooltip controller that
We are using a custom FTP application (which encrypts the files) for secure transfers.

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.