福尔摩斯操作栏与滑动菜单福尔摩斯、菜单、操作

2023-09-04 10:36:42 作者:不再见的情人

我在做一个视图和活动延伸SherlockMapActivity和使用SlidingMenu库,使我的主要观点,以滚动如Google一样。 我已经添加了SlidingMenu通过XML和我的看法完全滚动显示隐藏的菜单,但它只是在下面滚动操作栏的视图。在Google+应用也滚动操作栏,我已经看到有一个功能,使我的动作栏滑动启用,但它不能正常工作。

I'm making a view and an activity extending SherlockMapActivity and using SlidingMenu libraries to make my main view to scroll like Google+ does. I've added the SlidingMenu by XML and my view scrolls perfectly showing the hidden menu but it only scrolls the view below the action bar. In Google+ app it also scrolls the action bar and I've seen there's a function for making my action bar sliding enabled but it does not work.

什么是使我的操作栏的全貌滑动的最佳方式? 也许我不延长正确的类?

What would be the best way to make my action bar sliding with the full view? Maybe I'm not extending the correct class?

这是我怎么添加SlidingMenu到我的应用程序:

This is how I add the SlidingMenu to my app:

XML文件:

<com.slidingmenu.lib.SlidingMenu
    xmlns:sliding="http://schemas.android.com/apk/res-auto"
    android:id="@+id/slidingmenulayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    sliding:viewAbove="@layout/activity_main"
    sliding:viewBehind="@layout/menu_desplegado"
    sliding:behindOffset="120dip"
    sliding:behindScrollScale="0.25"
 />

这是结果:

推荐答案

我已经解决了我的问题。

I've solved my problem.

为了使我的动作条幻灯片,我不得不修改SlidingMenu是这样的:

In order to make my Action Bar to Slide, I had to modify the SlidingMenu this way:

在结帐ActionBarSherlock的全新副本,并导入到Eclipse工作空间。 添加ActionBarSherlock作为一个依赖于SlidingMenu。 走进你计划使用让他们延长,而不是__Activity Sherlock__Activity的SlidingActivities。

然后我伸出我的MainActivity从SlidingMapActivity它完美地工作。

Then I extended my MainActivity from SlidingMapActivity and it worked perfectly.