2017-04-24 3 views
0

J'ai appris Android pendant quelques mois mais j'ai plusieurs questions que je ne trouve pas de solution. Récemment, je suis quelques tutoriels où l'on explique à propos de TabLayout, Fragments et RecyclerView mais cela ne vaut pas pour moi. J'ai besoin d'une interface Android avec quelques onglets, avec un contenu différent, mais ce dont j'ai besoin c'est d'activer le défilement. Voici mon code:Android TabLayout et Fragments

<android.support.design.widget.CoordinatorLayout 
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/coordinator_main_content" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<android.support.design.widget.AppBarLayout 
    android:id="@+id/appbar" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 


    <android.support.design.widget.TabLayout 
     android:id="@+id/tabs" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     app:layout_scrollFlags="scroll|enterAlways" /> 

</android.support.design.widget.AppBarLayout> 


<android.support.v4.view.ViewPager 
    android:id="@+id/pager" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 

+0

En ce moment, balayez fonctionne bien, mais pas à l'intérieur de défilement ViewPager – Jotadrive

Répondre

1

SOLUTION: Pour résoudre ce problème, nous devons utiliser NestedScrollView