Artem  Shevchenko Artem Shevchenko - 1 year ago 126
Android Question

How to set backgorund color for BottomBar?

I using this library for using

in my app and I can't set background color for this

My code:

mBottomBar = BottomBar.attach(parent.findViewById(, savedInstanceState);
mBottomBar.setItemsFromMenu(, new OnMenuTabClickListener() {
public void onMenuTabSelected(@IdRes int menuItemId) {


public void onMenuTabReSelected(@IdRes int menuItemId) {


mBottomBar.mapColorForTab(0, ContextCompat.getColor(getActivity(), R.color.colorAccent));
mBottomBar.mapColorForTab(1, ContextCompat.getColor(getActivity(), R.color.colorAccent));

My BottomBar background color is white - I want set BootomBar like:
enter image description here

UPD 1 I tried this code:


But this change background on my content (Look to Content for nearby in screenshot), doesn't in

Answer Source

Try with this. It works for me

mBottomBar.getBar().setBackgroundColor(ContextCompat.getColor(getActivity(), R.color.colorAccent));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download