当前位置: 动力学知识库 > 问答 > 编程问答 >

android - Change transperency of main screen on DrawerLayout menu open

问题描述:

I am using Drawer Layout on my application's home screen to provide some menu options. when drawer opens I want to add some gradient or some invisibility to background activity. How can I do that?

I have used below two methods but it wont work and visibility od main screen remains same

mDrawerLayout.setDrawerShadow(getDrawable(R.drawable.loading_top_bar), GravityCompat.START);

and

mDrawerLayout.setScrimColor() Method

From both methods screen behind NavigationDrawer is clearly visible, I want to blur it so that it's visible but not clear

网友答案:

You can try to use

_drawerLayout.setScrimColor(Color.argb(128, 255, 255, 255));

you can create custom color with an opacity

分享给朋友:
您可能感兴趣的文章:
随机阅读: