首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Android Studio中的ScrollView,同时使用上拉刷新

Android Studio中的ScrollView,同时使用上拉刷新
EN

Stack Overflow用户
提问于 2018-06-15 04:09:51
回答 1查看 49关注 0票数 0

所以我有一个刷新向下滑动功能,当你从屏幕上的任何地方向下拉它refreshes...However我不想要这个,我有一个列表视图,这是由一个JSon object..this部件泵送的并不重要,我得到了所有的json working...the部件,我不知道如何使它,所以当我拉出列表视图时我在列表视图上向上,现在当我拉出整个页面刷新时。我对该页面的XML ...

代码语言:javascript
复制
<in.srain.cube.views.ptr.PtrClassicFrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/ptr_care"
    >

    <android.support.constraint.ConstraintLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context="com.fzhang.nhchecklist.ResidentCareActivity">


        <TextView
            android:id="@+id/care_summary_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:textColor="@android:color/black"
            tools:layout_constraintTop_creator="1"
            android:layout_marginStart="2dp"
            android:layout_marginTop="20dp"
            android:layout_marginBottom="20dp"
            tools:layout_constraintLeft_creator="1"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:layout_marginLeft="2dp" />


        <ListView
            android:id="@+id/care_info_listview"
            android:fadeScrollbars="false"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="0dp"
            android:layout_marginRight="0dp"
            android:layout_marginTop="10dp"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/care_summary_textview" />


    </android.support.constraint.ConstraintLayout>


</in.srain.cube.views.ptr.PtrClassicFrameLayout>

我的java

代码语言:javascript
复制
  mPtrFrame=(PtrClassicFrameLayout)findViewById(R.id.ptr_care);
        mPtrFrame.setLastUpdateTimeRelateObject(this);
        mPtrFrame.setPtrHandler(new PtrHandler() {
            @Override
            public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
                return PtrDefaultHandler.checkContentCanBePulledDown(frame, content, header);
            }

            @Override
            public void onRefreshBegin(PtrFrameLayout frame) {
                updateDataWithPTR();

            }
        });

任何人有任何好的想法,也有一个刷新和onResume...Though,这真的不重要(如果它确实请纠正我),谢谢你的帮助

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50865156

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档