动作条类似Evernote的 - 向上按钮和标签一排顶部与底部的菜单操作 [英] Actionbar like evernote - up button and tabs in one row on top with menu actions at bottom

查看:165
本文介绍了动作条类似Evernote的 - 向上按钮和标签一排顶部与底部的菜单操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序,它有动作条含 1)向上按钮,打开侧栏菜单导航,就像谷歌加 2)2操作菜单按钮 3)2片通过查看传呼机实施

I have app which has actionbar containing 1) up button which opens side bar menu for navigation just like google plus 2) 2 action menu buttons 3) 2 tabs implemented via view pager

我已经成功地实现动作条使用actionbarsherlock,其结果是 - >

I have successfully implementing actionbar using actionbarsherlock and the result is - >

我要实现类似Evernote的应用程序,其中向上按钮和标签都在一个行和操作菜单采用拆分动作条。我有图标的选项卡,以便配合他们了按钮,一排是不是一个问题。

i want to implement something like evernote app where up button and tabs are in one row and action menu uses split actionbar . i have icons for tabs so fitting them with up button in one row is not an issue

有人可以在正确的方向指向我,我怎么能有有在同一个水平杆的选项卡按钮,通过修改actionbarsherlock库。

can someone please point me in right direction as to how i can have have up button in the same horizontal bar as tab by modifying actionbarsherlock lib .

感谢

推荐答案

//使嵌入式标签

//pre-ICS
if (actionBarSherlock instanceof ActionBarImpl) {
    enableEmbeddedTabs(actionBarSherlock);

//ICS and forward
} else if (actionBarSherlock instanceof ActionBarWrapper) {
    try {
        Field actionBarField = actionBarSherlock.getClass().getDeclaredField("mActionBar");
        actionBarField.setAccessible(true);
        enableEmbeddedTabs(actionBarField.get(actionBarSherlock));
    } catch (Exception e) {
        Log.e(TAG, "Error enabling embedded tabs", e);
    }
}

//helper method
private void enableEmbeddedTabs(Object actionBar) {
    try {
        Method setHasEmbeddedTabsMethod = actionBar.getClass().getDeclaredMethod("setHasEmbeddedTabs", boolean.class);
        setHasEmbeddedTabsMethod.setAccessible(true);
        setHasEmbeddedTabsMethod.invoke(actionBar, true);
    } catch (Exception e) {
        Log.e(TAG, "Error marking actionbar embedded", e);
    }
}

有关进一步的参考 - https://groups.google.com/forum/#​​!topic/actionbarsherlock/hmmB1JqDeCk

for further reference - https://groups.google.com/forum/#!topic/actionbarsherlock/hmmB1JqDeCk

这篇关于动作条类似Evernote的 - 向上按钮和标签一排顶部与底部的菜单操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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