Turning off dark attenuation in the navigation box

Is there a way to turn off the dark fading effect for the background view in the navigation box view in Android?

+43
java android android-layout android-view navigation-drawer
Sep 23 '13 at 13:29
source share
4 answers

You can use the setScrimColor(int color) method. The default color is 0x99000000 . Therefore, if you do not need a faded background, set the color to transparent in this method.

 mDrawerLayout.setScrimColor(getResources().getColor(android.R.color.transparent)); 
+107
Sep 30 '13 at 16:29
source share
— -

Addition to the oblique answer: you can directly call colors from the Color class as follows:

 mDrawerLayout.setScrimColor(Color.TRANSPARENT); 
+33
Apr 24 '14 at 21:20
source share

drawerLayout.setScrimColor (Color.parseColor ("# 99000000"));

// For The Dark Attenuation Effect

  or 

drawerLayout.setScrimColor (Color.parseColor ("# 33000000"));

// For the fade effect

  or 

drawerLayout.setScrimColor (Color.TRANSPARENT);

// No attenuation

+7
Jun 30 '15 at 12:59
source share

You can customize the shadow:

 mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START); 
+4
Sep 23 '13 at 13:37
source share



All Articles