android-setting Pulltorefresh drop-down refresh style

Source: Internet
Author: User

android-setting Pulltorefresh drop-down refresh style

The following are the custom style properties of the open source control Pulltorefresh:

<?xml version= "1.0" encoding= "Utf-8"?><resources> <declare-styleable name= "Pulltorefresh" > &lt ;! --A drawable to use as the background of the refreshable View-<!--set the background color of the entire refresh list-<attr n Ame= "Ptrrefreshableviewbackground" format= "Reference|color"/> <!--A drawable to use as the background of th E Header and Footer Loading views-<!--set the dropdown Header or the background color of pull-up Footer-<attr name= "Ptrheaderba Ckground "format=" Reference|color "/> <!--Text color of the Header and Footer Loading views--&L t;! --Used to set the header and footer text color--<attr name= "Ptrheadertextcolor" format= "Reference|color"/> <!--        Text color of the header and Footer Loading views Sub Header-<!--used to set the color of the last refresh time in the header and Footer-  <attr name= "Ptrheadersubtextcolor" format= "Reference|color"/> <!--Mode of Pull-to-refresh that should    be used--    <attr name= "Ptrmode" > <flag name= "Disabled" value= "0x0"/><!--Disable drop-down refresh-< Flag name= "Pullfromstart" value= "0x1"/><!--only supports drop-down refresh-<flag name= "Pullfromend" value= "0x2"/> <!--only supports pull-up refresh-<flag name= "both" value= "0x3"/><!--pull-up refresh and drop-down refresh both support--<flag NA            Me= "Manualonly" value= "0x4"/><!--only allow manual trigger-<!--These last two is depreacted- <flag name= "Pulldownfromtop" value= "0x1"/> <flag name= "Pullupfrombottom" value= "0x2"/> &L T;/attr> <!--Whether the Indicator overlay (s) should be used-<!--If True will be in mpullrefreshlist icon appears in view, upper right and bottom right corner, very interesting--<attr name= "Ptrshowindicator" format= "Reference|boolean"/> <!--D Rawable to use as Loading Indicator. Changes both Header and Footer. -<!--simultaneously change the head and bottom icons--<attr name= "Ptrdrawable"format= "Reference"/> <!--drawable to use as Loading Indicator in the Header View. Overrides value set in Ptrdrawable. -<!--head View icons--<attr name= "Ptrdrawablestart" format= "Reference"/> <!--drawab Le to use as Loading Indicator in the Footer View. Overrides value set in Ptrdrawable.  -<!--bottom view icons--<attr name= "ptrdrawableend" format= "Reference"/> <!--Whether Android ' s built-in over Scroll should is utilised for Pull-to-refresh. --<attr name= "Ptroverscroll" format= "Reference|boolean"/> <!--Base text color, typeface, siz E, and style for headers and Footer Loading views--<!--set the type color of the font in the header or pull-up Footer, etc.--<  attr name= "ptrheadertextappearance" format= "Reference"/> <!--Base text color, typeface, size, and style for Header and Footer Loading views Sub header--<attr name= "PtrsubheadertextappearancE "format=" reference "/> <!--Style of Animation should is used displayed when pulling.  --<attr name= "Ptranimationstyle" > <flag name= "Rotate" value= "0x0"/><!--Flip (flip animation), Rotate (rotate animation)-<flag name= "Flip" value= "0x1"/> </attr> <!--Whether the US ER can scroll while the View is refreshing-<!--refreshes, whether the ListView or GridView is allowed to scroll--<attr name  = "ptrscrollingwhilerefreshingenabled" format= "Reference|boolean"/> <!--Whether Pulltorefreshlistview Has it ' s extras enabled. This allows the user to being able to scroll while refreshing, and behaves better.        It acheives the Adding Header and/or Footer views to the ListView. -<!--determines how Header,footer joins mpullrefreshlistview,true for Headview, that is, refreshing the head when scrolling is rolling together-and <attr Name= "ptrlistviewextrasenabled" format= "Reference|boolean"/> <!--WheTher the drawable should is continually rotated as you pull.        This is only takes effect when using the ' Rotate ' Animation Style.  --<attr name= "ptrrotatedrawablewhilepulling" format= "Reference|boolean"/> <!--BELOW here is Depreceated. Do not use. --<attr name= "Ptradapterviewbackground" format= "Reference|color"/> <attr name= "PtrDrawableTop "format=" reference "/> <attr name=" Ptrdrawablebottom "format=" reference "/> </declare-styleable> </resources>

You can set the custom styles in the layout file using the following methods:

<com.handmark.pulltorefresh.libaray        xmlns:ptr= "Http://schemas.android.com/apk/res-auto"        android:id= "@+id/lv"        android:layout_width= "match_parent"        android:layout_height= "Match_parent"        android: background= "@color/white"        android:cachecolorhint= "#00000000"        android:divider= "@drawable/border"        Android:fadingedge= "None"        android:fadingedgelength= "0dip"        android:scrollbars= "None"        android: Scrollingcache= "true"         ptr:ptrdrawable= "@drawable/infzm_logo"     />

Note: You need to declare the namespace:xmlns:ptr=Http://schemas.android.com/apk/res-auto

Using custom properties:ptr:ptrdrawable="@drawable/logo"

Other properties are used in a similar way.



android-setting Pulltorefresh drop-down refresh style

Related Article

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.