动作条类似Evernote的 - 向上按钮和标签一排顶部与底部的菜单操作按钮、菜单、类似、动作

2023-09-12 21:50:26 作者:中毒的爱情

我的应用程序,它有动作条含 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