Android – animation of action bar actions

I am using Android 4.2 and the latest version of appcompat. I use these methods to show and hide my action bar:

final ActionBar actionBar = getSupportActionBar();
actionBar.hide();
actionBar.show();

When the action bar is hidden, it will slide up gradually with smooth animation. However, when I display it, it appears on the screen almost immediately, and there is almost no smooth animation to slide down. What methods can I configure it to display it smoothly when hidden?

resolvent:

Try to enable the animation hidden / displayed by actionbar, which is not enabled by deault, so use the following code to enable the animation hidden / displayed:

actionBar.setShowHideAnimationEnabled(boolean enabled);

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>