suue
suue

Reputation: 344

How to position badge in a tab in Android Material 3

I have a tab layout with tab names only (no icons). I want to position a badge in a tab like in the documentation for Material 3 - aligned to the end of the label text

enter image description here https://m3.material.io/components/tabs/specs

What I get when using getOrCreateBadge on a non-icon tab by default is: enter image description here

The only available non-deprecated badgeGravities are TOP_START and TOP_END, I would expect there to be a gravity END to match documentation.

I also tried moving the badge with horizontalOffset and verticalOffset. I can move it to the right with negative horizontal offset, but moving it down with vertical offset doesn't work. Regardless, it's not an ideal option.

Upvotes: 1

Views: 71

Answers (0)

Related Questions