使用slidingmenu(jfeinstein10),怎么知道是否显示了滑动菜单(某些方法没有生效)

时间:2013-05-23 07:07:31

标签: android slidingmenu

使用slidingmenu(jfeinstein10),怎么知道是否显示了滑动菜单(某些方法没有生效)。 我想知道slidemenu的状态,我已经尝试过了:

        Log.d("slidingMenu.isShown()", slidingMenu.isShown()+"");
        Log.d("slidingMenu.isShown()", slidingMenu.getVisibility()+"");
        Log.d("slidingMenu.isShown()", slidingMenu.isActivated()+"");
        Log.d("slidingMenu.hasFocus()", slidingMenu.hasFocus()+"");
        Log.d("slidingMenu.hasFocusable()", slidingMenu.hasFocusable()+"");
        Log.d("slidingMenu.hasWindowFocus()", slidingMenu.hasWindowFocus()+"");
        Log.d("slidingMenu.isActivated()", slidingMenu.isActivated()+"");
        Log.d("slidingMenu.isClickable()", slidingMenu.isClickable()+"");
        Log.d("slidingMenu.isEnabled();", slidingMenu.isEnabled()+"");
        Log.d("slidingMenu.isFocusable()", slidingMenu.isFocusable()+"");
        Log.d("slidingMenu.isFocused()", slidingMenu.isFocused()+"");
        Log.d("slidingMenu.isSlidingEnabled()", slidingMenu.isSlidingEnabled()+"");
        Log.d("slidingMenu.isSelected()", slidingMenu.isSelected()+"");

但无论菜单片段显示还是消失,这些方法都会返回相同的值。

1 个答案:

答案 0 :(得分:1)

Line 550 in SlidingMenu.java

/**
 * Checks if is the behind view showing.
 *
 * @return Whether or not the behind view is showing
 */
public boolean isMenuShowing() {
    return mViewAbove.getCurrentItem() == 0 || mViewAbove.getCurrentItem() == 2;
}