Android SwipeRefreshLayout通过拖动禁用刷新

Android SwipeRefreshLayout通过拖动禁用刷新,android,google-maps,android-activity,android-progressbar,swiperefreshlayout,Android,Google Maps,Android Activity,Android Progressbar,Swiperefreshlayout,我想在SwipeRefreshLayout中显示一个google地图,以便在刷新标记时获得奇特的进度圈。我注意到您不能再向上移动地图,因为它会触发SwiperFreshLayout。我已经尝试过使用setDistanceToTriggerSync(),拉拽时它不再刷新,但我仍然无法向上移动地图。我正在使用的代码: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:

我想在SwipeRefreshLayout中显示一个google地图,以便在刷新标记时获得奇特的进度圈。我注意到您不能再向上移动地图,因为它会触发SwiperFreshLayout。我已经尝试过使用
setDistanceToTriggerSync()
,拉拽时它不再刷新,但我仍然无法向上移动地图。我正在使用的代码:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v4.widget.SwipeRefreshLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/map_refresh">

    </android.support.v4.widget.SwipeRefreshLayout>

    <fragment
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:name="com.google.android.gms.maps.SupportMapFragment" />

</LinearLayout>

如果需要
SwipeRefreshLayout
加载圆
,请在
SwipeRefreshLayout
标记内进行映射,并对父视图组使用
FrameLayout

您可以尝试以下代码:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             xmlns:tools="http://schemas.android.com/tools"
             android:layout_width="match_parent"
             android:layout_height="match_parent">

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/map_refresh"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <fragment
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:name="com.google.android.gms.maps.SupportMapFragment" />

    </android.support.v4.widget.SwipeRefreshLayout>

</FrameLayout>

要禁用手势和进度动画, 在视图上调用
setEnabled(false)

swipeRefreshLayout.setEnabled(false);

如果不想滑动刷新,为什么需要
SwipeRefreshLayout
。如果您只需要刷新映射,您可以尝试使用
SyncAdapter
jobscheduleAPI
。我只需要一个奇特的加载循环。您如何解决它?我帮了你还是帮了你?我刚刚把SwipeRefreshLayout类复制到我的项目中,并根据我的需要对其进行了修改。我也有同样的问题,你能发布答案吗?