splitActionBarWhenNarrow 在 Android 中到底是如何工作的?

发布于 2025-01-01 12:02:43 字数 267 浏览 1 评论 0原文

Android docs 描述 splitActionBarWhenNarrow 如下: “当水平空间受限时(例如在手机上处于纵向模式时),在屏幕底部添加一个栏以在 ActionBar 中显示操作项。”

但是“水平空间约束”是如何定义的呢?似乎没有办法定义这种分裂何时发生。

The Android docs describe splitActionBarWhenNarrow like this:
"Add a bar at the bottom of the screen to display action items in the ActionBar, when constrained for horizontal space (such as when in portrait mode on a handset)."

But how is "constrained for horizontal space" defined? There seems to be no way to define when this split occurs.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只为守护你 2025-01-08 12:02:43

我正在使用 ActionBarSherlock,当屏幕宽度低于 480dp 时,操作栏会被分割。
此行为由以下两个资源文件定义:

res/values-w480dp/abs_bools.xml

<resources>
    <bool name="abs__action_bar_embed_tabs">true</bool>
    <bool name="abs__split_action_bar_is_narrow">false</bool>
</resources>

res/values/abs_bools.xml

<resources>
    <bool name="abs__action_bar_embed_tabs">false</bool>
    <bool name="abs__split_action_bar_is_narrow">true</bool>
</resources>

我尚未检查这是否与 ICS 代码中的行为相同,但我很确定它是。

I'm using ActionBarSherlock and the action bar is split when the screen width is below 480dp.
This behaviour is defined by the two following resource files :

res/values-w480dp/abs_bools.xml

<resources>
    <bool name="abs__action_bar_embed_tabs">true</bool>
    <bool name="abs__split_action_bar_is_narrow">false</bool>
</resources>

res/values/abs_bools.xml

<resources>
    <bool name="abs__action_bar_embed_tabs">false</bool>
    <bool name="abs__split_action_bar_is_narrow">true</bool>
</resources>

I have not checked if this is the same behaviour as in ICS code but I'm pretty sure it is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文