Bottombar: Disable Text Under Icons

Created on 22 Aug 2016  路  10Comments  路  Source: roughike/BottomBar

Hello guys, can anyone tell me how to set bottombar to "only icon mode" ? I have the icons moved up, like the text was there, but i want to use only icons, having empty text there is not enought for it apparently, thanks in advance !

duplicate enhancement

Most helpful comment

Actually this library does support icon-only mode, though may be it's not straightforward. If you look into code, you'll notice that TextView's style (your label below icon) is: BB_BottomBarItem_TitleStyle (do not mix with text appearance - that's different). So you can override it like this:

<style name="BB_BottomBarItem_TitleStyle" parent="BB_BottomBarItem_TitleStyle"> <item name="android:visibility">gone</item> </style>

One last bit to do is to change container gravity (container is what hosts tab views like imageview, textview etc)

for (int i = 0; i < mBottomBar.getTabCount(); i++) { mBottomBar.getTabAtPosition(i).setGravity(Gravity.CENTER_VERTICAL); }

The above works for default BottomBar settings (likely for other settings as well, but I wasn't testing).

All 10 comments

I have the same issue.

same problem..

same for me

Actually this library does support icon-only mode, though may be it's not straightforward. If you look into code, you'll notice that TextView's style (your label below icon) is: BB_BottomBarItem_TitleStyle (do not mix with text appearance - that's different). So you can override it like this:

<style name="BB_BottomBarItem_TitleStyle" parent="BB_BottomBarItem_TitleStyle"> <item name="android:visibility">gone</item> </style>

One last bit to do is to change container gravity (container is what hosts tab views like imageview, textview etc)

for (int i = 0; i < mBottomBar.getTabCount(); i++) { mBottomBar.getTabAtPosition(i).setGravity(Gravity.CENTER_VERTICAL); }

The above works for default BottomBar settings (likely for other settings as well, but I wasn't testing).

Wow, it actully work somehow, thanks @oradkovsky

@roughike Please set the gravity to "center" in tab layouts. Also, would be nice to allow title hiding with xml attribute.

Ok that seems to work, but the problem is now the icons are too small, is there a way to increase the icon size since there is more space available with the text removed?

my issue is total opposite. i don't see any text under icons.

app:bb_titleTextAppearance="@dimen/bottom_text"

just override this with bottom_text=0dp

A duplicate of #373, so closing this one.

Expect to see this with the next release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LiuDeng picture LiuDeng  路  5Comments

yerenutku picture yerenutku  路  4Comments

giautm picture giautm  路  4Comments

Nolanus picture Nolanus  路  4Comments

cmonfortep picture cmonfortep  路  5Comments