質問

I work with jfeinstein10 / SlidingMenu Library, i followed all the instructions, but when I try sliding the menu is not seen, how to show it?

My Code

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        SlidingMenu menu = new SlidingMenu(this);
        menu.setMode(SlidingMenu.LEFT);
        menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
        menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
        menu.setMenu(R.layout.menu_frame);
        menu.setSlidingEnabled(true);
        menu.showContent();

    }
  }

in menu_frame layout i have FrameLayout and one TextView

役に立ちましたか?

解決

Try adding this after your setContentView

setBehindContentView(R.layout.name_of_your_menu_layout);

See if it helps!

他のヒント

Try the following code Which worked for me.

<?xml version="1.0" encoding="utf-8"?>
<com.slidingmenu.lib.SlidingMenu xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/slidingmenumain"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />

and in your main activity add the above sliding menu file...

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top