How to hide the animation of actionbar show and hide in android?

时光怂恿深爱的人放手 提交于 2019-12-11 04:17:18

问题


I have an activity contain an tabhost. And I use several fragments for the tabhost, each tab only has one fragment, that means the fragment size is matching the parent. However , not all fragment has actionbar.

For example, the first one hide actionbar while the other show the actionbar.

The problem is , when I show / hide the actionbar, it does not transacts instantly, but it has an amination that e.g. for the case hide->show , the actionbar is hide and leave a blank space on the screen , then the content screen will expand to fit the screen . It cause some "glitch" in the ui , so are there any way to fix it?

I tried requestWindowFeature(com.actionbarsherlock.view.Window.FEATURE_ACTION_BAR_OVERL‌​AY); Which the animation is hide but the actionbar is overlay the content instead of a part of the content,

Update:

The overlay of actionbar is like this screenshot , it is on top of the content. please have a look


回答1:


Please see a work around here for requestWindowFeature(com.actionbarsherlock.view.Window.FEATURE_ACTION_BAR_OVERL‌​AY);

Using ActionBarSherlock; experiencing View.getLocationOnScreen() inconsistency between 2.2 and ICS/JB

Also for the hide and show method can you please confirm if you are calling it within onCreate method of your fragment?

Could you post the code where you are making the call?



来源:https://stackoverflow.com/questions/21824472/how-to-hide-the-animation-of-actionbar-show-and-hide-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!