ActionBarDrawerToggle is not setting Drawer Indicator

前端 未结 4 1477
走了就别回头了
走了就别回头了 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 07:10

    This worked for me when I wanted to get the menu icon back from the back arrow

    private void updateNavigationIcon() {
        if (getSupportFragmentManager().getBackStackEntryCount() == 0
                && getSupportActionBar() != null) {
            getSupportActionBar().setDisplayHomeAsUpEnabled(false);
            toggle.syncState();
        }
    }
    

提交回复
热议问题