2017-04-24 3 views
0

Ich habe Android für ein paar Monate gelernt, aber ich habe mehrere Fragen, die ich nicht lösen kann. Kürzlich habe ich ein paar Tutorials über TabLayout, Fragments und RecyclerView gelesen, aber das ist es nicht wert für mich. Ich brauche eine Android-Schnittstelle, die ein paar Tabs, mit verschiedenen Inhalten, aber was ich brauche, ist Scroll aktivieren. Dies ist mein Code:Android TabLayout und Fragmente

<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

verwenden, Streichen funktioniert gut, aber keine Scroll innerhalb ViewPager – Jotadrive

Antwort

1

LÖSUNG: Um dies zu beheben, müssen wir jetzt rechts NestedScrollView