Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/178.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 无法在ActionBar中找到导航抽屉_Android_Navigation Drawer - Fatal编程技术网

Android 无法在ActionBar中找到导航抽屉

Android 无法在ActionBar中找到导航抽屉,android,navigation-drawer,Android,Navigation Drawer,在我的android项目中,最小API级别为11。 根据Android的指导原则,我需要一个指示器来显示滑动菜单的存在。我在MainActivity中添加了以下代码行: drawerToggle = new ActionBarDrawerToggle( this, /* host Activity */ drawerLayout, /* DrawerLayout object */

在我的android项目中,最小API级别为11。
根据Android的指导原则,我需要一个指示器来显示滑动菜单的存在。我在MainActivity中添加了以下代码行:

drawerToggle = new ActionBarDrawerToggle(
                this,                  /* host Activity */
                drawerLayout,         /* DrawerLayout object */
                R.drawable.ic_drawer,  /* nav drawer icon to replace 'Up' caret */
                R.string.drawer_open,  /* "open drawer" description */
                R.string.drawer_close  /* "close drawer" description */
                );
         // Set the drawer toggle as the DrawerListener
        drawerLayout.setDrawerListener(drawerToggle);
        getActionBar().setDisplayHomeAsUpEnabled(true);  
但是,我仍然没有看到顶部的3行表示存在滑动菜单。我做错了什么


是的,我确实在可绘图文件夹中有图标

您是否通过调用
OnConfiguration Changed()
OnOptions ItemSelected()
,并从
onPostCreate()
调用
syncState()
,如
ActionBarDrawerToggle
文档中所述!不!!