Ich habe es mit etwas seltsam zu ViewPager
, AppBarLayout
und Toolbar
.ViewPager Scroll-Layout Verhalten funktioniert nicht mit Toolbar
In meinem Layout, ich habe eine Standard-Material Design-Setup erhalten, wie zum Beispiel:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="...">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/grey_900"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_scrollFlags="scroll|enterAlways" />
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed"
app:tabGravity="fill"
app:tabBackground="@color/grey_900"
app:tabIndicatorColor="@color/white_1000"
app:tabIndicatorHeight="4dp" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.FloatingActionButton
...
app:layout_behavior="com.inkstinctapp.inkstinct.FabBehavior" />
</android.support.design.widget.CoordinatorLayout>
Mein ViewPager enthält vier Fragmente mit diesem Layout:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
android:layout_width="56dp"
android:layout_height="56dp"
android:indeterminate="true"
android:tint="@color/white_1000"
android:layout_centerInParent="true" />
<android.support.v4.widget.SwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
ich das nicht bekommen kann Toolbar zum scrollen, Ich habe versucht, jede Kombination von:
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_scrollFlags="scroll|enterAlways"
Keiner von ihnen scheint zu arbeiten, außer wenn ich die entfernen appbar_scrolling_view_behavior
von meinem Viewpager, was nicht in Ordnung ist, weil der Viewpager unter das AppBarLayout geht.
Was mache ich falsch? Jede Hilfe würde wirklich geschätzt werden!
Versuchen Hinzufügen 'App: layout_behavior = "@ Zeichenfolge/appbar_scrolling_view_behavior"' in 'RecyclerView' in Ihrem Fragment Layout – Rehan
Welche Version von appcompat verwenden Sie? 23.2 hatte einige Bugs mit AppBarLayout + SwipeRefreshLayout + SwipeRefreshLayout – marco
@Rehan nichts, die Symbolleiste ist immer noch nicht scrollbar .. danke übrigens – Matteo