关于下拉刷新库的属性 控件pull-to-refresh


<com.handmark.pulltorefresh.library.PullToRefreshGridView
    xmlns:ptr="http://schemas.android.com/apk/res-auto"
    android:layout_marginTop="@dimen/animal_species_margin"
    android:layout_marginStart="@dimen/animal_species_margin"
    android:layout_marginEnd="@dimen/animal_species_margin"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:columnWidth="@dimen/species_gridview_ih"
    android:gravity="center_horizontal"
    android:horizontalSpacing="@dimen/species_gridview_hs"
    android:numColumns="auto_fit"
    android:stretchMode="columnWidth"
    android:verticalSpacing="@dimen/species_gridview_vs"
    ptr:ptrAnimationStyle="flip"
    ptr:ptrHeaderBackground="#ffffff"
    ptr:ptrHeaderSubTextColor="#ff0000"
    ptr:ptrHeaderTextColor="@color/animal_weight_text2"
    ptr:ptrListViewExtrasEnabled="false"
    ptr:ptrMode="pullFromStart"
    ptr:ptrRefreshableViewBackground="#ffffff"
    ptr:ptrScrollingWhileRefreshingEnabled="true"
    ptr:ptrShowIndicator="true"



  

ptrMode设置上拉,或者下拉,both,

ptrDrawable设置自定义下拉图标

ptrAnimationStyle设置刷新动画,圈圈

ptrRefreshableViewBackground 设置整个mPullRefreshListView的背景色

ptrHeaderBackground 设置下拉Header或者上拉Footer的背景色

ptrHeaderTextColor 用于设置Header与Footer中文本的颜色

ptrHeaderSubTextColor 用于设置Header与Footer中上次刷新时间的颜色

ptrShowIndicator如果为true会在mPullRefreshListView中出现icon,右上角和右下角,挺有意思的。

ptrHeaderTextAppearance , ptrSubHeaderTextAppearance分别设置拉Header或者上拉Footer中字体的类型颜色等等。

ptrRotateDrawableWhilePulling当动画设置为rotate时,下拉是是否旋转。

ptrScrollingWhileRefreshingEnabled刷新的时候,是否允许ListView或GridView滚动。觉得为true比较好。

ptrListViewExtrasEnabled 决定了Header,Footer以何种方式加入mPullRefreshListView,true为headView方式加入,就是滚动时刷新头部会一起滚动。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值