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
Douyin Music Account has multiple practical opera...
Audit expert: Wang Guoyi Postdoctoral fellow in N...
This article is based on answering a question fro...
The death of all companies is caused by one reaso...
When you think of transparent things, what do you...
On the occasion of the New Year of 2020, Kuaishou...
China and the Gulf Cooperation Council countries ...
Spring is the season for all things to grow, and ...
There is a widely circulated formula in the Inter...
Sugarcane is a sweet and juicy fruit Always popul...
At MWC2017 this year, Meizu brought a new fast-cha...
2020 is a very unforgettable year in the hearts o...
From 2G to 3G, from 3G to 4G, and now 5G has arri...
Before and after the start of school, many teenag...
New report from ClubIntel analyzes how Generation...