嗨我有一个SwipeRefreshLayout,其中包含一个相对布局,其中包含滚动视图和另一个视图,当我向下滚动列表有时不会向上滚动而不是它运行onRefresh函数.除非视图位于顶部,否则如何阻止它运行?我读过有关canChildScrollUp但没有找到正确实现它的方法.
继承我的布局
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/profile"
android:background="@drawable/homepage_image_1">
<com.alldaypa.alldaypa.customviews.CircularImageView
android:layout_width="75dp"
android:layout_height="75dp"
app:border_color="#FFFFFF"
app:border_width="8dp"
app:shadow="false"
android:id="@+id/profile_image"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="70dp"
android:layout_marginTop="20dp"
android:src="@drawable/homepage_noimage_male"
android:clickable="true" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/profile_image"
android:layout_alignRight="@+id/profile_image"
android:src="@drawable/homepage_profile_add"
android:layout_marginRight="3dp"
android:layout_marginBottom="3dp"
/>
<TextView android:id="@+id/profile_name"
android:text="Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_alignTop="@+id/profile_image"
android:layout_toRightOf="@+id/profile_image"
android:layout_marginTop="20dp"
android:textColor="@color/darkgrey"
android:layout_marginLeft="10dp"/>
<TextView android:id="@+id/company"
android:text="Company"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_below="@+id/profile_name"
android:layout_alignLeft="@+id/profile_name"
android:textColor="@color/darkgrey"
android:layout_marginTop="-2dp"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/availability"
android:background="@color/white" …Run Code Online (Sandbox Code Playgroud) android ×1