如何隐藏的动作条显示的动画和隐藏在Android的? [英] How to hide the animation of actionbar show and hide in android?

查看:148
本文介绍了如何隐藏的动作条显示的动画和隐藏在Android的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个活动包含tabhost。我用几个片段为tabhost,每个标签只有一个片段,这意味着该片段大小相匹配的父。然而,并非所有片段具有动作条。

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?

我试着<$c$c>requestWindowFeature(com.actionbarsherlock.view.Window.FEATURE_ACTION_BAR_OVERL‌​AY); 其中动画是隐藏的,但动作条是覆盖内容的一部分,

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,

更新:

动作条的覆盖是这样的截图,它是在内容之上。请看看

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

http://www.thekirankumar.com/blog/wp-content/uploads/2013/02/picasion.com_1060caff20a6f01365ae6ec4728f0c86.gif

推荐答案

请参阅工作在这里的requestWindowFeature(com.actionbarsherlock.view.Window.FEATURE_ACTION_BAR_OVERL AY);

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

<一个href="http://stackoverflow.com/questions/11687889/using-actionbarsherlock-experiencing-view-getlocationonscreen-inconsistency-b">Using ActionBarSherlock; 2.2 ICS的经历View.getLocationOnScreen()不一致/ JB

也用于隐藏和显示方法,可以请您确认,如果您在您的片段onCreate方法中调用呢?

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

您可以张贴在code,你正在通话?

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

这篇关于如何隐藏的动作条显示的动画和隐藏在Android的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆