SlidingMenu from jfeinstein10 without ActionBarSherlock example

后端 未结 1 1574
野性不改
野性不改 2020-12-20 06:47

The last few days I\'ve been searching for examples on how to make a sliding menu. I\'ve found many ways and decided that jfeinstein10\'s solution should work best. But the

相关标签:
1条回答
  • 2020-12-20 07:17

    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();
    
    0 讨论(0)
提交回复
热议问题