You have to extend SherlockActivity
, and create a menu.xml
wich is your menu layout.
Then just add those few lines in your onCreate
method.
menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setShadowWidthRes(R.dimen.shadow_width);
menu.setShadowDrawable(R.drawable.shadow);
menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
menu.setFadeDegree(0.35f);
menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
menu.setMenu(R.layout.menu);
That what i'm using right now and works perfectly.
If you don't want ActionBar, just hide it like this :
ActionBar myBar = getActionBar();
myBar.hide();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…