側邊選單

一個很簡單、很方便,快速加側邊選單的Lib

下載點: simple-side-drawer

Demo image02


Step1: Add the library (加入該項LIb)

Add the jar library to your application project

Step2: Set up the side menu (設定Menu的Layout)

Add the 2 lines under the onCreate method in an Activity you want to add the side menu.
protected void onCreate(Bundle data) {
    super.onCreate( data );
    setContentView( R.layout.main );

    mSlidingMenu = new SimpleSideDrawer( this );
    mSlidingMenu.setLeftBehindContentView( R.layout.behind_menu_left );
}
The behind_menu.xml is the side menu layout. You can add it by calling setBehindeContentView method. That it you have to do for adding the side menu. If you want to handle the widget on the side menu, you just call findViewById method as usual.

Need the right-side?

mSlidingMenu.setRightBehindContentView( R.layout.behind_menu_right );

Step3: Open/Close the side menu(觸發開啟選單)

You can easy open/close the side menu.
mSlidingMenu.toggleDrawer();
Of course, a user can close the side menu by dragging the above view.

By Calvin Huo on 2013年12月1日 星期日 | | A comment?
0 responses to “側邊選單”

Leave a Reply