ViewPager
、AppBarLayout
、Toolbar
に関連する不思議なものを扱っています。私のレイアウトでViewPagerのスクロールレイアウトの動作がツールバーで機能しない
、私は標準のマテリアルデザインのセットアップを持っている、など:私のViewPagerはこのレイアウトで4つの断片が含ま
<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>
:
<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>
を私は得ることができませんツールバーをスクロールすると、次の組み合わせを試しました:
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_scrollFlags="scroll|enterAlways"
appbar_scrolling_view_behavior
私のビューページからは、ビューページがAppBarLayoutの下にあるので、これはOKではありません。
私は間違っていますか?どんな助けでも本当にありがとう!
フラグメントレイアウトの 'RecyclerView'に' app:layout_behavior = "@文字列/ appbar_scrolling_view_behavior"を追加してみてください – Rehan
どのバージョンのappcompatを使用していますか? 23.2 AppBarLayout + SwipeRefreshLayout + SwipeRefreshLayoutでいくつかのバグがありました – marco
@Rehan nothing、ツールバーはまだスクロールできません。 – Matteo