2

I started experimenting a bit with android studio. When I check the render in Android Studio, I can see that my app looks perfectly fine, but when I run it on my device there's some sort of shadow under the action bar that's bothering me. I don't know where it comes from because android studio doesn't shows this shadow. The shadow is present on both the nexus 5 and the nexus 7 (both lollipop). Any ideas in how to fix this?

  • Possible duplicate of http://stackoverflow.com/questions/12246388/remove-shadow-below-actionbar – Apurva Mar 15 '15 at 14:55

1 Answers1

3

For android 5.0, the shadow can be removed using the following code:

getSupportActionBar().setElevation(0);    // for support-library actionbar
getActionBar().setElevation(0);    // for non support-library actionbar

By the way, about preview in android studio and actual display effect in real device, you can have a look at this link different of the two display effect

Community
  • 1
  • 1
Terry Liu
  • 601
  • 5
  • 8