SlidingMenu is an open source Android development library that allows developers to easily create sliding menus in their Android apps, similar to the app menus of Google+, YouTube, and Facebook. Let's take a look at the effect of SlidingMenu. How to use A simple DEMO example:
XML configuration method If you want to use SlidingMenu as a view, the xml layout file can be written as follows:
Note: You cannot use behindOffset and behindWidth at the same time, otherwise an error will occur. Introduction to Android SlidingMenu Now many Android applications have side-sliding menus, which work very well. There is an open source library of SlidingMenu on GitHub, which is very convenient to use. SlidingMenu GitHub address: https://github.com/jfeinstein10/SlidingMenu. GitHub says that Sliding can be more functional when combined with ActionBarSherlock. ActionBarSherlock GitHub address: https://github.com/JakeWharton/ActionBarSherlock Next, let's introduce the use of SlidingMenu. (1) Download the zip file from GitHub and decompress it to get a folder called library. (2) Eclipse import Existing Android Code Into Workspace. Right-click the project and select Properties->Android. You can see that it is Library. (3) Right-click the project that will use SlidingMenu and select Properties->Android. Under Library, add the project imported in (2). (4) To ensure that the SlidingMenu library is successfully applied to the project, you must ensure that the libs used by the project and the libs used by the SlidingMenu library are consistent in version, mainly referring to android-support-v4.jar. If the project libs does not exist or the compilation fails, you can try to create a new libs folder and put android-support-v4.jar in it. Right-click on libs->Build Path->Use as Source. This can usually solve the problem. (5) After step (4), you can use SlidingMenu directly in your project. Java code: MainActivity:
XML layout code: layout/slidingmenu.xml:
Some common property settings for SlidingMenu are recorded as follows:
Original link: http://www.codeceo.com/article/android-slidingmenu-2.html Author: Xiaofeng from Coder.net |
<<: Exclusive interview with Umeng: Focusing on data services for the mobile development ecosystem
>>: HTML5 game performance is greatly improved, Egret Engine 1.5 is released
Cross-border import e-commerce is an activity in ...
In 2019, about two years ago, community operation...
Recently, a new variant of the Omicron virus, num...
The Ministry of Water Resources announced on Apri...
For educational institutions, there are relativel...
On October 1, Leapmotor announced its latest deli...
A big problem facing video creators is the issue ...
According to the career development stages of ope...
I am different from other optimizers because I wo...
Recently, AI data security startup Cyera complete...
From the globally popular game Pokemon Go to the ...
I was reading an article with 100,000+ views in m...
Guide to promotion and salary increase in large c...
Popular Science Times (Intern Wang Yuke) Engineer...
Why do people need oxygen? If oxygen inhalation i...