Skip to content Skip to sidebar Skip to footer

How To Put Some Finishing Touches (rounded Edges And Horizontal Divider) On My Custom Tabs

This is a follow up to my last question Link I wanted to make some small adjustments to the look of the tabs. I accomplished this by passing a view into setIndicator() instead of a

Solution 1:

I haven't got it all working yet, but in case anyone else is having trouble with this, here is what I learned.

for rounded corners (2): put something like this in the drawable you use for your tab indicator background. for me (and probably most others) that means nesting it within the shape tag in both 'tab_selected.xml' and 'tab_unselected.xml'

<cornersandroid:bottomLeftRadius="0dp"android:bottomRightRadius="0dp"android:topLeftRadius="5dp"android:topRightRadius="5dp" />

Note: What I would usually call a 'tab' in common language I believe is technically called a 'tab indicator' on android.

For the horizontal divider below the tab indicators (1): I am a little less clear on this still, but I think you could (1:a) add another shape tag to 'tab_unselected.xml' that will draw the line you specify.

alternatively, I believe you can (1:b) specify a drawable to use by setting 'tabStripEnabled', 'tabStripLeft', and 'tabStripRight' properties of the tabWidget.

Those are not so clear to me though.

well, I hope that can help someone struggling with this to at least get some ideas.

Post a Comment for "How To Put Some Finishing Touches (rounded Edges And Horizontal Divider) On My Custom Tabs"