Android Status Bar transparent with Navigation Drawer - Appbar elevation

后端 未结 3 1524
-上瘾入骨i
-上瘾入骨i 2021-01-07 06:03

I am working on an app with Material Design Guidelines. I have a boilerplate app created by Android Studio. For some reason the status bar has a little gradient at the botto

3条回答
  •  感动是毒
    2021-01-07 06:28

    You can do this by specifying the color of the status bar within the Java code. Within the OnCreate method of your activity, add a line of code:

    getWindow().setStatusBarColor(getResources().getColor(R.color.black));
    

    whereas the R.color.black might be changed to any value that you specified in your color.xml file.

    I have posted an article specifically talking about the strange status bar behavior. You can check that out here.

    Glad to know I'm not the only one bother by this.

提交回复
热议问题