【问题标题】:How to use Actionbar Tabs and Actionbar Spinner at the same time?如何同时使用 Actionbar Tabs 和 Actionbar Spinner?
【发布时间】:2013-03-20 21:44:18
【问题描述】:

我想实现将下载数据并将其设置到 ActionBar 选项卡中的应用程序。我已经实现了它,但我还有一件事要做。我尝试添加操作栏列表,例如 one,但 android 不允许同时使用 Tabs 和 List :( 按下 List 中的一项后,应用程序应下载相应的数据并适应它进入我的应用程序。(Example) 那我该怎么做呢?有什么方法可以在操作栏中安装微调器吗?如果是,请提供示例。

【问题讨论】:

    标签: android android-layout android-spinner android-tabs


    【解决方案1】:

    我可以这样做:

    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    

    导航是选项卡,但 ActionBar 有自定义视图。

    bar.setCustomView(R.layout.custom_actionbar);
    bar.setDisplayShowCustomEnabled(true);
    

    custom_actionbar 包含 spinner

    【讨论】:

    • 感谢您的回答。您能否提供 ActionBar 自定义视图 (xml) 的示例?
    • ActionBar 自定义视图与任何其他布局没有什么不同。只需在布局中有一个微调器或一些图像视图,并将其用作操作栏的自定义视图。自己试试吧。
    猜你喜欢
    • 1970-01-01
    • 2012-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多