1

Is there a way to remove the shadow from the default ActionBar? I only find solutions for custom ActionBars with "noActionBar" as default layout.

enter image description here

Florian Walther
  • 5,407
  • 3
  • 32
  • 84

1 Answers1

1
getWindow().requestFeature(Window.FEATURE_ACTION_BAR); 
getSupportActionBar().setElevation(0);

note : Go to the activity you want to remove the ActionBar's Elevation. Before setContent(....), request the ActionBar feature(That is if you have not declared it directly)

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)        
    {
        toolbar.setElevation(0.0f);
    }
Martijn Pieters
  • 963,270
  • 265
  • 3,804
  • 3,187
Sai Jayant
  • 366
  • 2
  • 14