有拆分动作条显示两倍的图标 [英] Have the split ActionBar display twice as many icons

查看:89
本文介绍了有拆分动作条显示两倍的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有一个应用程序的布局,因为他们使用Gmail的一个。他们有图标(我的设备上有应用程序标识,最多的导航,以及选择优先收件箱/收件箱/等自定义视图),但也有某种分裂的动作条动作条,因为在底部,我有几个图标(撰写,搜索,标签等)。

I'd like to have an app layout as the one they used for Gmail. They have the actionbar that has icons (on my device it has the app logo for up navigation, and a custom view for selecting priority inbox/inbox/etc), but there is also some kind of split ActionBar because at the bottom I have several icons (compose, search, labels, etc).

我怎么能这样做?我已经实现了以下动作条通过这个XML:

How could I do this? I have implemented the following ActionBar through this XML:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/menu_gps"
        android:icon="@drawable/icone_gps_continu"
        android:showAsAction="always"
        android:title="@string/menu_gps"/>
    <item
        android:id="@+id/menu_sort"
        android:icon="@drawable/icone_liste_chron"
        android:showAsAction="always"
        android:title="@string/menu_liste"/>
    <item
        android:id="@+id/menu_stats"
        android:icon="@drawable/icone_statistiques"
        android:showAsAction="always"
        android:title="@string/menu_stats"/>
    <item
        android:id="@+id/menu_save"
        android:icon="@drawable/icone_terminersortie"
        android:showAsAction="always"
        android:title="@string/menu_save"/>
    <item
        android:id="@+id/menu_search"
        android:icon="@drawable/ic_launcher"
        android:showAsAction="always"
        android:title="@string/menu_search"/>
    <item
        android:id="@+id/menu_photo"
        android:icon="@drawable/icone_enregistrerphoto"
        android:showAsAction="always"
        android:title="@string/menu_photo">
    </item>
    <item
        android:id="@+id/menu_sound"
        android:icon="@drawable/icone_enregistrerson"
        android:showAsAction="always"
        android:title="@string/menu_sound">
    </item>
    <item
        android:id="@+id/menu_settings"
        android:icon="@drawable/icone_parametres"
        android:showAsAction="always"
        android:title="@string/menu_settings">
    </item>

</menu>

和我当然有启用分割动作条加入安卓uiOptions =splitActionBarWhenNarrow我的&lt;应用&GT; 在清单标签

And I have of course enabled the split ActionBar by adding android:uiOptions="splitActionBarWhenNarrow" to my <application> tag in the manifest.

我所得到的不过是一个空的顶动作条;和底部之一仅显示三个图标。我以为我可以显示像3-4图标,在波泰特模式底部的顶部,5,和所有的人都在横向模式的顶部。

What I get though is an empty "top" ActionBar; and the bottom one is displaying only three icons. I thought I could display like 3-4 icons at the top and 5 at the bottom in portait mode, and all of them at the top in landscape mode.

请注意:即使我在ICS与我的Galaxy Nexus的测试,我使用ActionBarSherlock以提供向后兼容性

Note: even if I'm testing on ICS with my Galaxy Nexus, I'm using ActionBarSherlock in order to provide backward compatibility.

推荐答案

貌似我贴得太快,现在看来,这是不可能的。

Looks like I posted too fast, it seems it's not possible.

重复:

  • <一个href="http://stackoverflow.com/questions/9327720/how-to-place-actionbar-items-in-main-actionbar-and-bottom-bar">How以将动作条项目的主要动作条和底部酒吧
  • <一个href="http://stackoverflow.com/questions/8571754/android-split-action-bar-with-action-items-items-on-top-and-bottom">Android拆分操作栏在顶部和底部的行动项目?
  • How to Place ActionBar Items in Main ActionBar and Bottom Bar
  • Android Split Action Bar with Action Items on the top and bottom?

显然,这是不可能的。但是他们做到了在Gmail / gplus,也许使用自定义视图底部...仍然期待这是一个更好的答案!

Apparently this is not possible. However they did it in gmail/gplus, maybe using a custom view for the bottom part... Still expecting a better answer to this!

这个雷托•迈耶的话

我认为与分裂的顶部和底部之间的行动有关的问题是它会使其更难以执行动作。操作应该是最重要的事情做一个活动 - 在屏幕的顶部和底部之间分裂他们意味着用户需要在两个地方看看,而不是一个

I think the problem with splitting the actions between the top and bottom is that it would make it more difficult to perform actions. Actions should be the most important things to do on an Activity -- splitting them between the top and bottom of the screen means users need to look in two places rather than one.

这篇关于有拆分动作条显示两倍的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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