需要帮助导航抽屉

时间:2015-10-20 02:49:17

标签: android android-studio icons navigation-drawer

我已从https://developer.android.com/intl/es/samples/NavigationDrawer/res/drawable-mdpi/ic_drawer.html下载ic_drawer.png并将其粘贴到mipmap-hdpimipmap-mdpimipmap-xhdpimipmap-xxhdpi。但是我无法解析符号 ic_drawer

  actionBarDrawerToggle = 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 */
        );

如何解决这个问题?感谢

1 个答案:

答案 0 :(得分:2)

你应该把mipmap引用而不是drawable

R.mipmap.ic_drawer

如此处http://developer.android.com/reference/android/R.mipmap.html

所述