Android Remove Shadow On Navigation Drawer

后端 未结 3 1615
耶瑟儿~
耶瑟儿~ 2020-12-19 01:55

See here what i mean

Hi, I\'m using stock Navigation drawer v4 and i ask how can delete that background shadow when navigation drawer is open.

this is my cod

相关标签:
3条回答
  • 2020-12-19 02:11

    I find the solution :D

    mDrawerLayout.setScrimColor(getResources().getColor(android.R.color.transparent));
    

    Adding this in MainActivity.java

    0 讨论(0)
  • 2020-12-19 02:18

    You can use the setDrawerShadow method to point to a transparent drawable:

    navigationDrawer.setDrawerShadow(R.drawable.someDrawable, GravityCompat.START);
    
    0 讨论(0)
  • 2020-12-19 02:33

    This is works for me in androidX

    /*Navigation drawer with transparent background*/
    drawerLayout.setScrimColor(getResources().getColor(android.R.color.transparent));
    
    /*Remove navigation drawer shadow/fadding*/
    drawerLayout.setDrawerElevation(0);
    
    0 讨论(0)
提交回复
热议问题