0

I am trying to simulate a large AppBar that is adding some extra layout to it.

For this, I place a layout just below the AppBar and assign the same color to it, but I get the elevation shadow as you can see in this picture:

enter image description here

I tried to configure a 4dp elevation for my layout (I tried with 8dp also) to avoid the shadow, but it doesnt dissappear.

How can I make that shadow go to simulate a big AppBar?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Mr.Eddart
  • 10,050
  • 13
  • 49
  • 77

2 Answers2

2

Try this:

ActionBar actionBar = getSupportActionBar();
actionBar.setElevation(0f);

Or You can make Your own view and use it as action bar like in this answer:

https://stackoverflow.com/a/15519711/5343907

Pavel B.
  • 805
  • 10
  • 13
2

in the xml file for your layout if you adding AppBarLayout tag you can define elevation and setting it to 0dp

<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    app:elevation="0dp"></android.support.design.widget.AppBarLayout>
Shalan93
  • 774
  • 1
  • 7
  • 20