Java – slidingmenu width incorrect
•
Java
I use jfeinstein1's slidingmenu library. In my project I want to slide the slide menu out to about 3 / 4 of the screen width According to the documentation, this should be available
setBehindWidth() setBehindOffset()
But for now, the menu slides all the way to the right and covers the entire screen Here is my code:
public void setupMenu() { setContentView(R.layout.activity_base); menu = new SlidingMenu(this); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setBehindWidth(100); menu.setBehindOffset(100); menu.attachToActivity(this,SlidingMenu.SLIDING_CONTENT); menu.setMenu(R.layout.sliding_menu); }
Thank you in advance
Solution
I have a menu that slides from the right, just call:
getSlidingMenu().setMode(SlidingMenu.RIGHT); getSlidingMenu().setBehindOffset(100);
Hope to help
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码