如何在 Android 上创建多个操作栏(如 Gmail 应用程序)

发布于 2024-12-24 03:56:07 字数 274 浏览 4 评论 0原文

在 Android Ice Cream Sandwich 上,GMail 应用程序在线程视图中具有类似操作栏布局的电子邮件标题。正如您在纵向模式的屏幕截图中看到的,标题只有 2 个图标,其余操作隐藏在溢出菜单中。在横向模式下,所有操作都是可见的。 “真实操作栏”位于顶部。如何创建类似的额外酒吧?

肖像模式 横向模式

On Android Ice Cream Sandwich the GMail App has in the thread view, email headers with a action-bar-like layout. As you can see in the screenshots in portrait mode a header has only 2 icons and the remaining actions are hidden in an overflow menu. In landscape mode all actions are visible. The "real action bar" is at the top. How can you create additional bars like that?

portraint mode
landscape mode

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

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

发布评论

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

评论(2

乖乖 2024-12-31 03:56:07

这是应用程序的一部分,而不是系统的一部分。 SDK 不提供此功能,但您可以获取系统操作栏源代码并将其用作模型/灵感来集成到您的应用程序中。最终,它只是一个带有您单击的一些图标/按钮的布局。如果您为纵向和横向模式提供不同的布局,则可以实现类似的效果。

This is part of the application, not the system. This functionality is not provided by the SDK, but you could take the system action bar source code and use as a model/inspiration to integrate in your app. Ultimately, it's just a layout with some icons/buttons you click on. If you provide different layouts for portrait and landscape mode, you can achieve something similar.

各自安好 2024-12-31 03:56:07

已经过去很长时间了,但如果您仍在寻找答案,我相信这是通过 SplitActionBar 完成的。

要启用拆分操作栏,只需添加
uiOptions="splitActionBarWhenNarrow"
给你的
清单元素。

您可以找到 Android 文档中提供的信息
http://developer.android.com/guide/topics/ui/actionbar.html

It has been long time, but if you are still looking for answer, I believe it is done via SplitActionBar.

To enable split action bar, simply add
uiOptions="splitActionBarWhenNarrow"
to your
<activity> or <application> manifest element.

you can find the information provided in Android Documentation
http://developer.android.com/guide/topics/ui/actionbar.html

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