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
  • 6,237
  • 5
  • 46
  • 104

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
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Sai Jayant
  • 366
  • 2
  • 14