BottomBar
BottomBar copied to clipboard
Programmatically Set background color
Hello,
Previously i set my background color using android:background="@color/colorBottomBarBackground" but then i got a requirement to fetch background color from my backend.
I've tried setting bottombar.setbackgroundColor() but the color default to white, any one have solution for this?
same
I figured it out.
BottomBar bBar = (BottomBar) findViewById(R.id.bottomBar);
bBar.setOnTabSelectListener(this);
BottomBarTab tab1 = bBar.getTabAtPosition(0);
tab1.setBarColorWhenSelected(Color.WHITE)
BottomBarTab tab2 = bBar.getTabAtPosition(1);
tab2.setBarColorWhenSelected(Color.WHITE)
bBar.selectTabAtPosition(0)
It's a bit clumsy, but it works. @Kiruel @nicchong