GridView加载刷新连带单独的图片用(ScrollView和GridView)解决冲突

studio到入桌面框架gridView上拉刷新下拉加载目录下PullRefreshLibrary框架
//XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <com.handmark.pulltorefresh.library.PullToRefreshScrollView
        android:id="@+id/f0_pullscrollview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">
            <ImageView
                android:layout_width="match_parent"
                android:layout_height="150dp"
                android:scaleType="fitXY"
                android:src="@mipmap/ll_bg3"/>
            <com.zmy.friendsmyapp.main2.Fragment.Luck.MYGirdview.MY_GridView.MyGridView
                android:id="@+id/f0_pullgridview"
                android:layout_width="match_parent"
                android:layout_height="490dp"
                android:numColumns="3"
                >

            </com.zmy.friendsmyapp.main2.Fragment.Luck.MYGirdview.MY_GridView.MyGridView>
        </LinearLayout>
    </com.handmark.pulltorefresh.library.PullToRefreshScrollView>
</LinearLayout>


//main
//自定义的gridView
f0_mygridView = (MyGridView) view.findViewById(R.id.f0_pullgridview);
//scrollview 
f0_pullscrollview = (PullToRefreshScrollView) view.findViewById(R.id.f0_pullscrollview);


   adapter = new Myf0Grid_Adapter(getActivity());
   f0_mygridView.setAdapter(adapter);

        //设置滚动监听
        f0_pullscrollview.setMode(PullToRefreshBase.Mode.BOTH);
        f0_pullscrollview.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ScrollView>() {
            @Override
            public void onPullDownToRefresh(PullToRefreshBase<ScrollView> refreshView) {
                userList1.clear();
                currPage=1;
//                currPage++;
                getIonInfo_luck();
                //停止刷新
                f0_pullscrollview.onRefreshComplete();
            }

            @Override
            public void onPullUpToRefresh(PullToRefreshBase<ScrollView> refreshView) {
                currPage++;
                getIonInfo_luck();
                //停止刷新
                f0_pullscrollview.onRefreshComplete();
            }
        });


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值