Animate drawer icon into arrow on setDisplayHomeAsUpEnabled?

前端 未结 3 746
一个人的身影
一个人的身影 2020-12-07 18:21

I\'m using setDisplayHomeAsUpEnabled in order to show the arrow instead of the drawer \"burger\" icon but it\'s not getting animated or anything. Instead it shows the arrow

3条回答
  •  被撕碎了的回忆
    2020-12-07 18:49

    Sounds like it's working as intended, you can use setDisplayHomeAsUpEnabled to simply enable the home button to be used as a back button, there is no animation.

    If you're using a navigation drawer and want the animation don't use setDisplayHomeAsUpEnabled and for material theme (at least with AppCompat v21) make sure you use ActionBarDrawerToggle from the v7 package.

    The Play Store is a good example. At the top level you have an activity with a nav drawer and a hamburger that animates when you open the drawer. If you tap on an app it opens a new activity that has a back arrow.

提交回复
热议问题