ActionBarDrawerToggle is not setting Drawer Indicator

前端 未结 4 1531
走了就别回头了
走了就别回头了 2021-02-04 06:09

I am trying to add the navigation drawer in my app.. Everything is working fine But now I still got the arrow icon although I replaced it with the ic_drawer from Android? Here\'

4条回答
  •  耶瑟儿~
    2021-02-04 06:46

    Just add the following line inside showGlobalContextActionBar() method (NavigationDrawerFragment.java class)

    actionBar.setHomeAsUpIndicator(R.drawable.ic_action_menu);
    

    Code snippet:

    private void showGlobalContextActionBar() {
            ActionBar actionBar = getActionBar();
            actionBar.setDisplayShowTitleEnabled(true);
            actionBar.setHomeAsUpIndicator(R.drawable.ic_action_menu);
            actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
            actionBar.setTitle(R.string.app_name);
        }
    

提交回复
热议问题