1

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

        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()+"");

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

4

1 回答 1

1

第 550 行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;
}
于 2013-05-23T07:11:50.620 回答