1、导入依赖
2、MainActivity.Java
//slidingmenu的侧滑布局
View view = View.inflate(HomeActivity.this, R.layout.cehua_left, null);
//创建slidingmenu对象
final SlidingMenu slidingMenu = new SlidingMenu(HomeActivity.this);
slidingMenu.setMode(SlidingMenu.LEFT);
slidingMenu.setBehindOffset(100);
slidingMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
//避免slidingmenu与viewpager的冲突
slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
slidingMenu.setMenu(view);