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
China Association for Science and Technology Wome...
Ever since Google's artificial intelligence A...
Have you ever experienced a situation where you h...
Recently, the China Academy of Information and Co...
Many people ask, is it difficult to learn Faceboo...
The era of Internet big data is striding into a n...
2018 marks a new stage for China’s Internet going...
Is she the child her mother doesn't want? Is ...
The New Bride Stone in Nanyan, the thunderbolt pr...
In order for an activity to be successful, adequa...
For friends who are still doing SEO optimization,...
“The head can be cut off, but the hairstyle canno...
We often mention "using scenario-based think...
The deep sea has always been beautiful and myster...
Recently, I occasionally discuss some issues with...