所以我有一个刷新向下滑动功能,当你从屏幕上的任何地方向下拉它refreshes...However我不想要这个,我有一个列表视图,这是由一个JSon object..this部件泵送的并不重要,我得到了所有的json working...the部件,我不知道如何使它,所以当我拉出列表视图时我在列表视图上向上,现在当我拉出整个页面刷新时。我对该页面的XML ...
<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
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,这真的不重要(如果它确实请纠正我),谢谢你的帮助
https://stackoverflow.com/questions/50865156
复制相似问题