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
In recent days, many parts of southern China have...
[[421835]] 12306 has launched the Love Mode, whic...
As we all know, this year's Android flagship ...
Before we knew it, it was already June. The tempe...
Q: How to identify mini programs using WeChat? We...
As an important device for home entertainment, TV...
On the morning of August 28, it was reported that...
《Cotton Swab Medical Science Popularization》 Tao ...
Two months after the release of the Meizu Blue 3,...
Video account IP evolution wealth camp, from 0 to...
In nature, all kinds of animals have evolved diff...
I've been busy with a project recently and ha...
With the frequent outbreaks of the epidemic, have...
As the temperature drops day by day, the atmosphe...
With the rapid development of the mobile Internet...