Uda*_*day 7 android navigation-drawer
我用导航抽屉活动创建了一个新的Android应用程序.当我执行应用程序时,右上角的图标显示后箭头,但它必须是3行的图标.
图标R.drawable.ic_drawer就是这个

在NavigationDrawerFragment类中.
// 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 */
)
Run Code Online (Sandbox Code Playgroud)
当我执行应用程序时,我正在右侧显示箭头图标.

选择后,Icon也是一样的.

我现在该如何改变它?
希望这会有所帮助,我通过这种方式解决了上述问题。@shkschneider 是对的。为了让你的代码工作导入android.support.v7.app.ActionBarDrawerToggle
mDrawerToggle = new ActionBarDrawerToggle(this,
mDrawerLayout,
R.string.drawer_open,
R.string.drawer_close){
@Override
public void onDrawerClosed(View drawerView) {
getSupportActionBar().setTitle(mTitle);
invalidateOptionsMenu();
}
@Override
public void onDrawerOpened(View drawerView) {
getSupportActionBar().setTitle(mDrawerTitle);
invalidateOptionsMenu();
}
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3255 次 |
| 最近记录: |