android:错误SlidingMenu与Sherlockbar

时间:2014-01-27 14:24:28

标签: java android actionbarsherlock slidingmenu slidingdrawer

朋友您好我正在尝试将我的应用中的滑动菜单与sherlock actionbar for android 2.3

集成

经过几个小时的搜索,我找不到解决方案

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <com.jeremyfeinstein.slidingmenu.lib.SlidingMenu
        xmlns:sliding="http://schemas.android.com/apk/res-auto"
        android:id="@+id/slidingmenulayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        sliding:behindOffset="15dp"
        sliding:behindScrollScale="50"
        sliding:behindWidth="150dp"
        sliding:fadeDegree="3.5"
        sliding:selectorDrawable="@drawable/abs__cab_background_top_holo_light"
        sliding:selectorEnabled="false"
        sliding:shadowDrawable="@drawable/ic_launcher"
        sliding:shadowWidth="3dp"
        sliding:touchModeAbove="margin"
        sliding:viewAbove="@layout/activity_main"
        sliding:viewBehind="@layout/menu" />

</LinearLayout>

这是我的java文件

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        SlidingMenu menu = new SlidingMenu(this);
        menu.setMode(SlidingMenu.LEFT);
        menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
        menu.setFadeDegree(0.35f);
        menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
        menu.setMenu(R.layout.menu);
    }

0 个答案:

没有答案