确定是否操作栏是分裂 [英] Determine if action bar is split

查看:139
本文介绍了确定是否操作栏是分裂的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图形页面与操作杆搭载ActionBarSherlock。操作栏是两个分割(在窄屏幕)和叠加/半透明(安卓windowActionBarOverlay是真的)。或多或少,如谷歌地图应用程序。

I have a MapView with an action bar powered by ActionBarSherlock. The action bar is both split (on "narrow" screens) and overlayed / semi-transparent (android:windowActionBarOverlay is true). More or less like the Google Maps app.

现在,我想推的观点在地图之上,在屏幕仍然保持其上方的底部操作栏的底部。我在这里的问题是,我不知道底部操作栏的高度。坦率地说,我甚至不能找到一种方法来知道它是否绘制与否。 的getHeight()似乎返回顶部操作栏的高度(或者也许是他们两人的高度,但我还是不知道底部操作栏存在,或不是。

Now I would like to push views on top of the map, at the bottom of the screen still keeping it above the bottom action bar. My problem here is that I don't know the height of the bottom action bar. Frankly, I can't even find a way to know if it's drawn or not. getHeight() seems to return the height of the top action bar (or perhaps it's the height of both of them but I still don't know if the bottom action bar exists or not.

请告诉我这个信息是正确的,我的眼前!

Please, tell me this information is right in front of my eyes!

推荐答案

如果您使用的是ActionBarSherlock你可以看看布尔值abs__split_action_bar_is_narrow

If you are using ActionBarSherlock you can look for the boolean value abs__split_action_bar_is_narrow

只是创造一些静态方法,你可以做

Just create some static method where you can do

return ResourcesCompat.getResources_getBoolean(context,
                            R.bool.abs__split_action_bar_is_narrow);

您需要使用ResourcesCompat(从actionbarsherlock)类,因为pre 3.2不能读取指标的文件夹(如值-SW480)

you need to use the ResourcesCompat (from actionbarsherlock) class because pre 3.2 cant read folders with metrics (like values-sw480)

这篇关于确定是否操作栏是分裂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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