与操作栏和标签Android的布局 [英] Android layout with action bar and tabs

查看:130
本文介绍了与操作栏和标签Android的布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Andr​​oid,我需要你的建议。我想有动作栏中选择一个活动,我也需要标签(而不是标签的动作条)和下拉列表中的动作栏导航。当我点击例如第一个选项卡,在导航列表中的动作条应该填充数据的时候秒标签,导航列表应该充满另一个数据等,当标签被改变的行动项目也应改变。当我从导航列表中的动作条选择一些项目则认为应该更新。我不知道如何做到这一点。

I'm new to Android and I need your advice. I would like to have an activity with action bar, I need also tabs (but not tabs in actionbar) and drop down list in action bar to navigate. When I click on e.g. first tab, the navigation list in actionbar should be filled with data, when seconds tab, navigation list should be filled with another data, and etc., the action items should also be changed when the tab is changed. When I select some item from navigation list in actionbar then the view should be updated. I'm not sure how to make it.

我用ActionBarSherlock的动作条,我也用TabHost和TabWidget与碎片已经标签,当我点击选项卡上,然后片段被改变,但是这不正是我想要的,我不知道该怎么办下一个。你能帮助我吗?

I use ActionBarSherlock for actionbar, and I have already tabs using TabHost and TabWidget with fragments, when I click on the tab, then fragment is changed, but this is not exactly what I want, and I have no idea what to do next. Could you help me?

下面是一个屏幕:

当我点击标签1,则导航列表中的动作条应TAB1 List1中,TAB1列表2等,以及应显示第一次从列表的默认视图(例如第一TAB1的List1)或最后由用户选择的观看来自导航列表。 当我点击选项卡上,名单应该是TAB2 List1中,TAB2列表2等,并应显示如TAB2列表2视图。等等 所以,每一个选项卡调整动作条。

When I click on the Tab 1, then the navigation list in actionbar should be Tab1 List1, Tab1 List2 etc. and should be shown first time the default view from the list (e.g. first Tab1 List1) or last selected by the user view from the navigation list. When I click on the tab 2, list should be Tab2 List1, Tab2 List2 etc. and should be shown e.g. Tab2 List2 view. etc. So every tab adjust the actionbar.

推荐答案

您有两种选择:

  1. 使用列表导航操​​作栏中放置一个 TabWidget 在内容视图的顶部。
  2. 操作栏中的
  3. 使用标签导航,并设置自定义视图微调
  1. Use list navigation in the action bar and place a TabWidget at the top of your content view.
  2. Use tab navigation in the action bar and set a custom view with a Spinner

要小心,不要超负荷用户。通常有两种类型的导航可能会造成混淆。

Be careful not to overload your users. Usually two types of navigation can be confusing.

这篇关于与操作栏和标签Android的布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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