J'ai 3 onglets et ces onglets ont recyclerview dans swiperefreshlayout. Je ne peux pas changer ces onglets avec swipe. Je pense que c'est parce que, mon événement tactile est reçu par swiperefreshlayout au lieu de tablayout. Comment résoudre mon problème?Utilisation de SwipeRefreshLayout avec Viewpager et Tablayout
Après la mise en page est ma
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/news_swipe_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.nabinkhadka.hamrodang.activity.NewsActivity"
tools:showIn="@layout/app_bar_main">
<android.support.v7.widget.RecyclerView
android:id="@+id/news_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.v4.widget.SwipeRefreshLayout>
Problèmes:
- Si je déplace ViewPager ci-dessus RecyclerView, puis les travaux swipe mais Recyclerview ne peut pas être vu.
- Si je crée un Relativelayout pour ces deux et placer chacun au-dessus de l'autre, je ne serai pas en mesure de faire des événements tactiles sur l'un d'eux
Comment puis-je obtenir un travail autour?
Merci!