BottomNavigationBar underneath NavBar

后端 未结 3 421

The Goal:

1) Make the status bar transparent - Done

2) Make the BottomNavigationView and the Navbar

3条回答
  •  失恋的感觉
    2020-12-11 02:59

    I haven't tested this code but, most probably it should work

     if (Build.VERSION.SDK_INT >= 21) {
        setWindowFlag(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
                | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, false);
        getWindow().setStatusBarColor(Color.TRANSPARENT);
        getWindow().setNavigationBarColor(Color.TRANSPARENT);
    }
    

    The code you have added allows the window to extend outside the actual output area.So. most probably that is allowing your activity to come beneath system widgets that is status bar and nav bar and giving them a transparent look.

    Try to remove the code you mentioned from java activity and replace it with mine. I hope it helps.

提交回复
热议问题