ActionBarActivity with ActionBarDrawerToggle - Not using drawerImageRes

后端 未结 3 1494
北荒
北荒 2020-12-28 18:54

Working from this android example, I\'ve attempted to create an app that uses the support version (android.support.v4 and android.support.v7).

The example creates a

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-28 19:40

    You can do it with the support libraries. The only difference I can see from my working version with the ActionbarActivity is a call to super like this:

    public void onDrawerClosed(View drawerView)
    {
        super.onDrawerClosed(drawerView);
        getSupportActionBar().setTitle(mTitle);
        supportInvalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
        Log("onDrawerOpened()");
    }
    
    public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            getSupportActionBar().setTitle(mDrawerTitle);
            supportInvalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
            Log("onDrawerOpened()");
    }
    

提交回复
热议问题