views:

101

answers:

1

Hi,

Is the android:divider attribute under the TabWidget working? I tried the Tab Layout tutorial from android just to test (http://developer.android.com/resources/tutorials/views/hello-tabwidget.html) and set the android:divider to some image (for now I used the android vertical scrollbar as the drawable to really emphasize if its getting picked up (copied it from frameworks), but when I ran it on the emulator, it doesn't appear to be working. According to the docs, the TabWidget does seem to support this attribute: "Drawable used to draw the divider between tabs."

Can anyone help? I am using a nine-patched drawable as my divider image drawable.

MB

A: 

It doesn't look like the divider attribute is available anymore for TabWidget. One way to add a custom divider is to set it programmatically:

mTabHost.getTabWidget().setDividerDrawable(R.drawable.divider_vertical_dark);

Make sure however, you call this before you set the content of the tabs. It would crash on me if I called it after.

Josh Clemm