Hamburger Icon does not show in Navigation Drawer Fragment

前端 未结 2 1277
耶瑟儿~
耶瑟儿~ 2021-02-08 22:53

I am using a Fragement for navigation drawer and hence can\'t use onPostCreated to call syncState

public class NavigationDrawerFragment extends Frag         


        
2条回答
  •  半阙折子戏
    2021-02-08 23:31

    I had this problem as well. For me, importing android.support.v7.app.ActionBarDrawerToggle instead of android.support.v4.app.ActionBarDrawerToggle fixed it. You also have to remove the R.drawable.ic_drawer argument when you define mDrawerToggle:

    mDrawerToggle = new ActionBarDrawerToggle( getActivity(), mDrawerLayout, R.string.navigation_drawer_open, R.string.navigation_drawer_close )

    If that doesn't work, try some of the answers to this question.

提交回复
热议问题