-1

How do I make the actionbar fully invisible but still functional. I should only see the icons I have and the title but the colour should be removed.

I tried like below:

toolbar.getBackground().setAlpha(0)

In my onCreate, but that just makes it white.

The XML code in my activity which sets the toolbar colour is here:

    <android.support.design.widget.AppBarLayout android:layout_width="match_parent"
    android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar android:id="@+id/toolbar"
        android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.AppBarLayout>
Rolf ツ
  • 8,464
  • 5
  • 46
  • 72
JamMan9
  • 584
  • 1
  • 5
  • 21

2 Answers2

0

You can set setBackgroundDrawable to transparent color

Same issue discussed here

Leonid Veremchuk
  • 1,913
  • 14
  • 26
0
ActionBar actionBar = getActionBar();

actionBar.setStackedBackgroundDrawable(newColorDrawable(Color.parseColor("#550000ff")));
AskNilesh
  • 63,753
  • 16
  • 113
  • 150