Basic tutorials on Android slidingmenu and actionbarsherlock

Source: Internet
Author: User

If you are not talking nonsense, you can directly get into the subject. Please carefully read the process and instructions below.

First, go to the slidingmenu official website and download a piece of code,

Decompress the package. The directory is as follows:

Figure-1

The following describes how to import slidingmenu.

Figure 2

1. Import the file selected in figure-1 to eclipse, just as if you were importing a source code: tool bar file -- import -- Android -- existing Android code into wokingspace. Because it is a library, you do not need to set the is library after the import.

2. Clean the project after the import. Toolbar project -- clean

3. Because the slidingmenu project uses the code of actionbarsherlock of another open-source project, it needs to be imported to eclipse and then used as a library for slidingmenu.

This is the directory after the actionbarsherlock is decompressed and the selected part is imported. It is also a library.

4. Right-click the slidingmenu project and name it liabrary. Select build path -- select Android --

Click Add, add actionbarsherlock, apply, and click OK.

At this time, an error occurs,

This is because slidingmenu and actionbarsherlock both use the android-suppotr-v4 package, delete the android-suppotr-v4 package in libs in slidingmenu.

5. If you use the activties of actionbarsherlock, You need to replace the activyties of Android with the activities encapsulated by actionbarsherlock.

6. Create a new project. If you want to use slidingmenu, import the library slidingmenu. Also delete the android-suppotr-v4 package because there is an actionbarsherlock in it.

The last example is very simple. Let's take a look at the effect:

7. The last note is that if you want to save the Demo code, you must not only save the code of slidingmenudemo, but also save the slidingmenu Library and the Library of actionbarsherlock. Import the above three projects together during running.

 

OK

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.