安卓导航栏

发布于 2024-12-04 03:27:18 字数 253 浏览 2 评论 0原文

我已经进行了大量搜索,但似乎找不到任何对我有帮助的东西。我是 Android 编程新手(不过我确实了解 Java),并且我正在开发一个处理从服务器下载动态内容的应用程序。我想要一个底部导航栏,它在整个应用程序中始终存在。该导航栏由 5 个按钮组成,单击这些按钮将打开一个新活动。不过,我希望将活动加载到导航栏上方的内容区域中。

所以基本上我会有一个包含内容视图和导航控制器的布局。导航控制器永远不应该改变...内容视图应该在单击导航按钮时加载新的活动。有人有什么想法吗?谢谢。

I've done a great amount of searching and I can't seem to find anything that helps me. I'm new to Android programming (I do know Java though), and I am working on an app that deals with dynamic content being downloaded from a server. I would like to have a bottom navigation bar, that is persistent throughout the app. This nav bar will consist of 5 buttons, that when clicked will open a new activity. However I would like the activity to be loaded in the content area above the nav bar.

So basically I will have a layout that contains a content view and the nav controller. The nav controller should never change...the content view should load a new activity upon nav button click. Does anyone have any ideas? Thanks.

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

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

发布评论

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

评论(3

紫竹語嫣☆ 2024-12-11 03:27:18

您必须为导航栏创建一个通用布局,并将其包含在活动的每个布局中。使用 xml 中的“include”标签来执行此操作。请看看下面的讨论,它可能会对您有所帮助。

每个活动底部的常用按钮或选项卡

You will have to create a common layout for the navigation bar , and include it in every layout of the activity. use "include" tag in the xml to do this. please have a look at the discussion below, it may help you.

Common buttons or tabs at bottom for every activity

紙鸢 2024-12-11 03:27:18

您可能需要考虑查看 Fragments 因为 TabActivity 已被弃用。您需要在 SDK 中下载兼容包以便在预蜂窝设备上使用它。它应该能够完全按照你的意愿去做。

You might want to consider looking at Fragments since the TabActivity is deprecated. You would need to download a compatibility package in the SDK in order to use it on pre-honeycomb devices. It should be able to do exactly as you want.

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