The android Ultra-PullToRefresh(Ultra-ptr) slide up causes the top of the ScrollView to be hidden



The process of overusing Fresco from Picasco a while ago was enjoyable, because there was a minor problem in the middle of trying Ultra-ptr (due to problems with PTR integrated lib and years of no maintenance). I searched a lot of data and found out the reason for the problem. The problem was to use ScrollView to slide up to the bottom and then drop down. The result couldn't be pulled down.The top is hidden or truncated.

At first the layout was written like this


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fresco="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <include layout="@layout/base_title_layout" />
    <in.srain.cube.views.ptr.PtrFrameLayout
        android:id="@+id/ptrF"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <com.facebook.drawee.view.SimpleDraweeView
                android:id="@+id/simImg1"
                style="@style/fresco_SimpleDraweeView_sytle"
                android:layout_width="match_parent"
                android:layout_height="150dp" />

Later changed to this


<?xml version="1.0" encoding="utf-8"?>
<in.srain.cube.views.ptr.PtrFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ptr2"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <com.facebook.drawee.view.SimpleDraweeView
                android:id="@+id/simImg1"
                android:layout_width="match_parent"
                android:layout_height="150dp"
                android:background="@color/gray" />

In this way, the specific reasons have not been explored.

Tags: Android xml encoding

Posted on Fri, 17 Jul 2020 12:41:21 -0400 by rhecker