我已经创建了一个新的Android应用程序,其中包含导航抽屉活动。
当我执行该应用程序时,右上角的图标显示为后退箭头,但应该是三条线的图标。
图标 R.drawable.ic_drawer 如下:
在 NavigationDrawerFragment 类中修改。
当我执行该应用程序时,右侧会出现箭头图标。 选择后,图标仍然相同。 现在该怎么改变它呢?
图标 R.drawable.ic_drawer 如下:
![enter image description here](https://istack.dev59.com/cXAcP.webp)
// ActionBarDrawerToggle ties together the the proper interactions
// between the navigation drawer and the action bar app icon.
mDrawerToggle = new ActionBarDrawerToggle(
getActivity(), /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
R.string.navigation_drawer_open, /* "open drawer" description for accessibility */
R.string.navigation_drawer_close /* "close drawer" description for accessibility */
)
当我执行该应用程序时,右侧会出现箭头图标。 选择后,图标仍然相同。 现在该怎么改变它呢?
android.support.v4.app.ActionBarDrawerToggle
还是android.support.v7.app.ActionBarDrawerToggle
?第一个已经被弃用了。除此之外,当关闭时它会回到原来的形状,所以这似乎是正常行为。 - shkschneider