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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:39:06+00:00 2026-05-17T01:39:06+00:00

In my Android app I use a TabWidget without any special customization. I’d like

  • 0

In my Android app I use a TabWidget without any special customization. I’d like Android to take care of the specific appearance, which works fine if you compare Android 1.6 with 2.1 for example. By just using a TabWidget the same code leads to different forms of tabs because the SDK defines how to draw it.
Here is how it looks on 2.1 for example:

alt text

So, the highlighted tab is gray and the font is white and you can read it quite well.

But, if you have HTC Sense, it looks like this:
alt text

The picture isn’t that good, but just believe me that it’s white text on white background which is not really that easy to read…

My questions are:

1) Why does Android create a TabWidget with white on white text? I never defined either the text color or the background color, so the system is supposed to chose sensible colors.

2) I assume that other TabWidgets look just fine on HTC Sense, because otherwise it would be quite a big and popular problem. So why is my TabWidget having this problem and not others.

3) How can I fix this problem without changing the appearance on non Sense devices?

As I said I did not customize the TabWidget in any way. Here is my definition:

<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="@android:color/black"
    >
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >

        <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="0dp"
            >
      <ScrollView 
            android:id="@+id/shortenerScrollView"
            android:layout_height="fill_parent" 
            android:layout_width="fill_parent"
            android:background="@android:color/black"
            android:fadingEdge="horizontal"
            >

So, besides defining black as my general background color of the app, there’s no color or style defintion made. The only exception might be that I’m using standard Android ids for TabHost and TabWidget.

/Edit:
Here’s the defintion of the tabs in the onCreate method:

th = getTabHost();
th.addTab(th.newTabSpec("shortener").setIndicator(getString(R.string.tabShortenerName),
        res.getDrawable(R.drawable.url_zip)).setContent(R.id.shortenerScrollView));

The class extends a TabActivity.

/Edit 2:
The device that comes up with the white on white text is a HTC Legend running Android 2.1 btw.

/Edit 3:
dream3r was right. Changing the targetSdk value to 4 did the trick for me, too (before, it was set to 6)! I don’t really get it, but I can live with that for now. 🙂

Here’s a picture of how it looks now:
alt text

  • 1 1 Answer
  • 3 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-17T01:39:07+00:00Added an answer on May 17, 2026 at 1:39 am

    Do you have android:targetSdkVersion set in your AndroidManifest.xml?

    I made some test using sample application and I have the same issue if I set targetSdkVersion to value greater than 4.

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

Sidebar

Related Questions

I'm working on an Android app in which I would like to use multi-touch.
I found some examples in the web which use android.app.ActivityThread but I can't find
I'm currently working on an Android app. I would like to use the app
I have an app which I want to use instead of the standard android
I have an Android app in which I use a HashMap to store container
How to secure WCF service which an Android app will use? Currently we are
Im about to make a android app and would like to use In-App-purchase in
I have built an android app which use Google Map feature. I want my
I have an Android app which I use to register users on my web
I have an Android app, which is intended for use by about 10 people,

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.