Drawer indicator in lollipop play store

后端 未结 5 2006
-上瘾入骨i
-上瘾入骨i 2020-12-24 08:52

I am using a Nexus 7 with the Android 5.0 preview build.

On this page http://developer.android.com/tools/support-library/index.html

I see

5条回答
  •  爱一瞬间的悲伤
    2020-12-24 09:03

    You seem to have a working drawer as I read it, if not, the Documentation on "Creating a Navigation Drawer" is pretty good.

    Updated ActionBarDrawerToggle, which contains the menu-to-arrow animation

    enter image description here

    The above quote refers to Create a new ActionBarDrawerToggle with arrow and hamburger menu commit. As a related one: setDrawerIndicatorEnabled was added in Add ability to disable drawer indicator in new ArrowDrawer.

    So make sure setDrawerIndicatorEnabled is not called with false and use

    import android.support.v7.app.ActionBarDrawerToggle;
    

    instead of

    import android.support.v4.app.ActionBarDrawerToggle;
    

    which should be pretty obvious from deprecation warnings anyway:

    @deprecated Please use ActionBarDrawerToggle in support-v7-appcompat.

    Probably also need

    // showHome|homeAsUp
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    

提交回复
热议问题