//添加左边菜单 slidingMenu= new SlidingMenu(this); slidingMenu.setMenu(R.layout.left_content); //setBehindContentView(R.layout.left_content); getSupportFragmentManager().beginTransaction().replace(R.id.left_content,new LeftFragment()).commit(); //设置slidingMenu相关属性 //slidingMenu = getSlidingMenu(); //设置左滑菜单 slidingMenu.setMode(SlidingMenu.LEFT_RIGHT); //设置滑动的屏幕范围,边缘可以滑动:SlidingMenu.TOUCHMODE_MARGIN边缘滑动,TOUCHMODE)全屏滑动 slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN); //滑动时主页面剩余的宽度 slidingMenu.setBehindOffsetRes(R.dimen.BehindOffsetRes); //设置右边菜单 slidingMenu.setSecondaryMenu(R.layout.right_content); getSupportFragmentManager().beginTransaction().replace(R.id.right_content,new RightFragment()).commit(); slidingMenu.attachToActivity(this,SlidingMenu.SLIDING_CONTENT);
08-24
08-24
09-13