带有多个图标的android导航抽屉

时间:2014-07-04 09:49:26

标签: android menu android-actionbar slider navigation-drawer

我目前正在尝试通过稍微更改来修改现有Android应用程序的UI。我需要实现的一个改变是修改3个图标之一(开,关,'特殊')之间的导航抽屉/滑块切换图标。在实例化时创建ActionBarDrawerToggle时提供图标,并且似乎不是在创建对象后修改值的方法。有谁知道是否有可能实现这一目标(黑客攻击还是没有攻击)?

提前致谢, thisguy

1 个答案:

答案 0 :(得分:0)

在此处查看此指南:http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/

在这里:http://developer.android.com/training/implementing-navigation/nav-drawer.html

我想你可能会在ActionBarDrawerToggle的方法上改变图标:

/** Called when a drawer has settled in a completely closed state. */
        public void onDrawerClosed(View view) {
            super.onDrawerClosed(view);
            getActionBar().setTitle(mTitle);
            invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
        }

        /** Called when a drawer has settled in a completely open state. */
        public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            getActionBar().setTitle(mDrawerTitle);
            invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
        }
    };