因此,我使用ViewPager和其中的2個片段進行活動。在每個片段中,我放置了SwipeToRefreshLayout和一個ListView。 Xml看起來像這樣:使用ViewPager片段中的SwipeToRefresh佈局問題
<?xml version="1.0" encoding="utf-8"?>
*<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/going_out_activity_swipe_to_refresh"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">*
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/going_out_activity_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_going_out"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_tab_new"/>
</RelativeLayout>
</android.support.v4.widget.SwipeRefreshLayout>
現在,出現了問題。當列表超出我的屏幕,我不得不向下滾動查看項目,當我嘗試向後滾動時,它不會滾動,它會刷新(調用SwipeToRefreshLayout)。我怎樣才能解決這個問題?
這一個工程像列表視圖魅力。謝謝。 –