-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,611
  • 6
  • 47
  • 72
JamMan9
  • 706
  • 2
  • 9
  • 22

2 Answers2

0

You can set setBackgroundDrawable to transparent color

Same issue discussed here

Leonid Veremchuk
  • 1,952
  • 15
  • 27
0
ActionBar actionBar = getActionBar();

actionBar.setStackedBackgroundDrawable(newColorDrawable(Color.parseColor("#550000ff")));
AskNilesh
  • 67,701
  • 16
  • 123
  • 163