我有如下布局:包含一个主RelativeLayout。 RelativeLayout包含两个SwipeToRefereshLayout。问题只是First SwipeToRefereshLayout是Scrollable。
<RelativeLayout
android:id="@+id/rltUserActivity"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_to_refresh_media_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/viewTop"
android:background="@color/white"
android:visibility="gone">
<android.support.v7.widget.RecyclerView
android:id="@+id/recFeedGrid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_to_refresh_newsfeed_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/viewTop"
android:background="@color/white"
android:visibility="gone">
<ListView
android:id="@+id/lvFeed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparant"
android:divider="@null"
android:nestedScrollingEnabled="false" />
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
在这里,在上面的代码中,当我把swipe_to_refresh_media_grid
放在swipe_to_refresh_newsfeed_list
之上,那么只有swipe_to_refresh_media_grid
是可滚动的,问题是swipe_to_refresh_newsfeed_list
不可滚动。在任何时候都可以看到它们中的任何一个。
我在谈论在特定的SwipeToRefereshLayout内部滚动RecyclerView和ListView。
问题:第一个集合在Relativelayout中可滚动,第二个集合不可滚动。
可能是什么问题?
删除此并尝试
android:nestedScrollingEnabled="false"