0

在left_right模式下使用SlidingMenu库时如何处理二级菜单打开事件我找到了OpenListener for BehindContentView菜单的代码

getSlidingMenu().setOnOpenListener(new OnOpenListener() {           
        @Override
        public void onOpen() {
            // TODO Auto-generated method stub
             Toast.makeText(MainActivity.this,"left menu",Toast.LENGTH_SHORT).show();

        }
    });

我如何为二级菜单添加类似的监听器?

4

1 回答 1

1

几乎相同的..

/**
 * Sets the OnOpenListner for secondary menu  {@link OnOpenListener#onOpen() OnOpenListener.onOpen()} will be called when the secondary SlidingMenu is opened
 * 
 * @param listener the new OnOpenListener
 */

public void setSecondaryOnOpenListner(OnOpenListener listener) {
    mSecondaryOpenListner = listener;
}

https://github.com/jfeinstein10/SlidingMenu/blob/master/library/src/com/jeremyfeinstein/slidingmenu/lib/SlidingMenu.java#L887

于 2013-08-02T07:53:03.157 回答