navigation drawer google maps v2 , map blocking drawer

前端 未结 4 1052
走了就别回头了
走了就别回头了 2020-12-29 06:54

I have this problem when opening drawer on gingerbread and behind is google map v2. Map that should be on screen behind gets on top of everything.

Now I could bypas

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-29 07:44

    You should override the onDrawerSlide function and move the drawer to front

     Toolbar toolbar = (Toolbar) findViewById(R.id.tool_bar);
        DrawerLayout  Drawer = (DrawerLayout) findViewById(R.id.DrawerLayout);
                        mDrawerToggle = new ActionBarDrawerToggle(this, Drawer, toolbar, R.string.openDrawer, R.string.closeDrawer) {
    
                            @Override
                            public void onDrawerSlide(View drawerView, float slideOffset)
                            {
                                super.onDrawerSlide(drawerView, slideOffset);
                                Drawer.bringChildToFront(drawerView);
                                Drawer.requestLayout();
                                Drawer.setScrimColor(Color.TRANSPARENT);
    
                            }
                        };
    

提交回复
热议问题