BottomBar icon indicating copy to clipboard operation
BottomBar copied to clipboard

Programmatically Set background color

Open nicchong opened this issue 8 years ago • 2 comments

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?

nicchong avatar Oct 25 '16 07:10 nicchong

same

Kiruel avatar Nov 03 '16 18:11 Kiruel

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

widavies avatar Jun 01 '17 16:06 widavies