Sliding back swipebacklayout of open source projects

Source: Internet
Author: User

This question mainly introduces the use of Swipebacklayout

Swipebacklayout support left and right side slide, and swipe up to return to the upper level


Library Resources: Https://github.com/ikew0ng/SwipeBackLayout


Import Process:

1. After downloading, get a compressed package, unzip and import the library inside

2. After the import, you will find that the SRC folder is empty, do not worry. In the project there is a Java folder, the Java folder under the entire file copy to SRC, you can.

3. Although SRC has, but will find the code error. To other projects, the Lib folder including Android-support-v4.jar copy come, will not error


Use:

1. In your own project, import the swipebacklayout library

2. Create a class that inherits Swipebackactivity

3. After running, you can slide back, the default is to slide back to the right, if you want to set the slide in the other direction back, you can set:

Edgeflag = Swipebacklayout.edge_left; Swipe right edgeflag = swipebacklayout.edge_right;   Swipe left edgeflag = swipebacklayout.edge_bottom;//up slide Edgeflag = Swipebacklayout.edge_all; Can be slid in 3 directions

4. If the background black screen during the sliding process, it can be resolved as follows:

1) in styles, customize a style to inherit apptheme, and then add a property

<item name= "Android:windowistranslucent" >true</item>

2) in the manifest file, set the theme to a custom style and run it again.


5. If you want to click the return key also has a similar sliding effect, need to rewrite onbackpressed ()

@Overridepublic void onbackpressed () {scrolltofinishactivity ();}


Sliding back swipebacklayout of open source projects

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.