0

I am trying to add a white triangle to the bottom of tabhost to indicated the open tab like this: enter image description here

I have the white triangle png. Just wondering how I can style tabhost to add an image below the text for active tabs

This is the background resource I am setting to the tabhost.

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/tabselectedcolor"     android:state_selected="true" />
    <item android:drawable="@drawable/tabunselcolor" />
</selector>

Thank you very much.

Bill Huang
  • 89
  • 1
  • 10

1 Answers1

0

Take this with a grain of salt, but have you looked into using the setCompoundDrawables method of the TextViews inside your tabhost?

Something like this

textViewTitle.setCompundDrawables(null,null,null,triangleDrawable);

This might be worth looking into.. you could then add or remove the drawable when a tab is switched.

Nick H
  • 8,897
  • 9
  • 41
  • 64