dannyroa
dannyroa

Reputation: 5571

Style Top & Bottom Part of Divider for Tab Widget

enter image description here

I have a TabWidget and I'm trying to style the divider. (See image above)

I set the Divider Drawable of the TabWidget but the top & bottom part is unchanged. I can't figure out how to style it.

Upvotes: 1

Views: 2155

Answers (3)

Darren Shen
Darren Shen

Reputation: 81

It seems that Holo theme has default 16 pixels dividerPadding for each TabWidget. I try to set it to zero in the XML but it is not working. Fortunately, it works for me to set it dynamically as below

myTabHost.getTabWidget().setDividerPadding(0);

Note: I am using android.support.v4.app.FragmentTabHost

Upvotes: 1

adneal
adneal

Reputation: 30804

All you need to do is set the dividerPadding attribute to 0dp in your TabWidget.

android:dividerPadding="0dp"

Also, maybe consider switching to ActionBar.Tabs instead, just considering TabWidget is deprecated.

Upvotes: 3

Niraj Adhikari
Niraj Adhikari

Reputation: 1728

are you talking about grey bars on the top and the bottom of the divider? use fill_parent for the drawable's height and width if that is the case!

Upvotes: 0

Related Questions