CC American Group Slide Delete (Swipelistview)

Source: Internet
Author: User

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6F/D0/wKiom1WpNU-yOeTrAAGRJhRvb-Q076.jpg "title=" Swipe to delete. png "alt=" wkiom1wpnu-yoetraagrjhrvb-q076.jpg "/>



    1. In the purchase segment

Private Swipelistview Mlistview;


Modifying the Pulltorefreshlistview class in the Lib_pull library

public class Pulltorefreshlistview extends Pulltorefreshadapterviewbase<swipelistview> {


Private Loadinglayout Mheaderloadingview;

Private Loadinglayout Mfooterloadingview;

Protected class Internallistview extends Swipelistview implements Emptyviewmethodaccessor {


Private Boolean maddedlvfooter = false;


Public Internallistview (context context, AttributeSet Attrs) {

Super (context, attrs);

}

The pulltorefreshadapterviewbase<listview> inherited by Pulltorefreshlistview is a generic class, Swipelistview inherits from ListView so you can use Swipelistview as a generic parameter


2. In XML

<com.handmark.pulltorefresh.library.pulltorefreshlistview

Android:id= "@+id/ptr_list"

android:layout_below= "@+id/tuangou_actionbar"

Android:layout_width= "Fill_parent"

android:layout_height= "Fill_parent"

Android:cachecolorhint= "#00000000"

Android:divider= "#19000000"

android:dividerheight= "4DP"

Android:fadingedge= "None"

Android:fastscrollenabled= "false"

Android:footerdividersenabled= "false"

Android:headerdividersenabled= "false"

Android:smoothscrollbar= "true"

ptr:ptrdrawablestart= "@drawable/refresh_image"

Ptr:ptrheadertextcolor= "#C59502"

ptr:swipebackview= "@+id/back"

Ptr:swipecloseallitemswhenmovelist= "true"

ptr:swipedrawablechecked= "@drawable/choice_selected"

ptr:swipedrawableunchecked= "@drawable/choice_unselected"

ptr:swipefrontview= "@+id/front"

Ptr:swipemode= "both"/>

3, for Swipelistview set Setswipelistviewlistener () monitoring, the occurrence of Setonitemclick () event monitoring failure

Workaround: Override the Onclickfrontview method for Baseswipelistviewlistener

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/2f5eb7762b2dbed24c52e5997cdb910a/ 7c18c89ef638439fb006d3be2caac88b "style=" Border:none;line-height:1.5;width:577.6451612903227px;height:auto; "alt = "7c18c89ef638439fb006d3be2caac88b"/>

4 . When you swipe to delete a row layout object for a ListView, a row layout object has been deleted, but the row layout object is also displayed as a left-swipe state (the background that appears to slide to the left is deleted).

solution:650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/ 2F5EB7762B2DBED24C52E5997CDB910A/C4EED69CBB43413FB4E74910C90B2CEC "style=" Border:none;line-height:1.5;height: auto;width:672.4637681159419px; "alt=" C4eed69cbb43413fb4e74910c90b2cec "/>

5.There are Viewpager controls in the Swipelistview Headerview, andtheevent listener for all controls in Swipelistview fails after sliding Viewpager control.

               reason: swipelistview intercepted viewpager sliding event monitoring, which caused the Viewpager slide to be invalid.

Workaround: Create a class to inherit Viewpager and rewrite 650) this.width=650; "src=" Http://note.youdao. com/yws/public/resource/2f5eb7762b2dbed24c52e5997cdb910a/d91eab129f0e46f5a3e7d8282f7f1d6b "style=" border:none; line-height:1.5;height:auto;width:510.00000000000006px; "alt=" d91eab129f0e46f5a3e7d8282f7f1d6b "/>

Make Swipelistview no longer occupy focus



Thanks: Guo, earth, Guo Zhen Yingde, its Peng, home Xin's help, new blogger 18 class This big collective, we will always be mutual assistance, progress together

CC American Group Slide Delete (Swipelistview)

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.