我已从https://developer.android.com/intl/es/samples/NavigationDrawer/res/drawable-mdpi/ic_drawer.html下载ic_drawer.png
并将其粘贴到mipmap-hdpi
,mipmap-mdpi
,mipmap-xhdpi
,mipmap-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 */
);
如何解决这个问题?感谢
答案 0 :(得分:2)
你应该把mipmap引用而不是drawable
R.mipmap.ic_drawer
如此处http://developer.android.com/reference/android/R.mipmap.html
所述