Android 自定义标签栏
我正在寻找创建一个类似于 Iphone 的选项卡栏的选项卡式应用程序。我的应用程序中将有一个底部选项卡栏,它将转到某些屏幕。
(我的页面布局示例):
[tab1] 图书列表 ->书籍详情
[tab2] 设置1 ->设置2
[tab3] 关于
我需要每个选项卡都有自己单独的导航堆栈。因此,如果我从“图书列表”转到“设置 1”,再转到“设置 2”,然后按返回,我预计会进入“设置 1”。从那里,如果我按回键,我希望仍停留在“设置1”上,因为所有选项卡都是相互独立的。
1) 我尝试使用 Android 的本机选项卡主机,但选项卡放置在顶部...所以我将选项卡放置在 XML 布局的底部。
问题:但是我的手机滚轮无法正常工作:当我在选项卡上并且想要访问上述内容时,我向上滚动(良好)。当我在内容上并想要进入下面的选项卡时,我必须向上滚动(不好,您应该向下滚动才能找到它)。
是否可以向下滚动到达选项卡并向上滚动返回内容?
2) 有谁知道任何其他较少的 GPL API 可以实现这一点吗?或者我必须从头开始?
谢谢。
I am looking to create a tabbed application similar to Iphone's tab-bar. There will be a bottom tab bar in my app which will go to certain screens.
(example of my page layout):
[tab1] Book List -> Book Details
[tab2] Settings1 -> Settings2
[tab3] About
I need each tab to have its own separate navigation stack. So if I go from Book List to Settings1, to Settings2 and press back, I expect to be on Settings1. From there if I press back, I expect to still stay on Settings1 because all the tabs are separate from each other.
1) I tried using Android's native Tab Host but the tabs are placed at the top... so I placed the tabs at the bottom in my XML layout.
Issue: However my phone's scroll wheel doesn't work properly: When I'm on the tab and I want to get to the above content, I scroll UP (GOOD). When I'm on the content and want to get to the below tab I have to scroll UP (BAD, you should scroll DOWN to get it).
Is it possible to scroll down to reach the tab and scroll up to go back to the content?
2) Does anybody know any other lesser-GPL API that can achieve this? Or must I start from scratch?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在
TabWidget
中使用layout_gravity="bottom"
在底部显示标签栏,如下所示:You can use
layout_gravity="bottom"
inTabWidget
to show tab bar in bottom like this: