Un de mes projets utilise une classe de comportement commune pour masquer/montrer le bouton Fab qui fonctionne parfaitement. Maintenant, faites quelques changements d'exigences de mise en page, le show fab sur scroll up ne fonctionne pas.FloatingActionButton problèmes de défilement avec RecyclerView à l'intérieur de FrameLayout
La configuration de CoordinatorLayout est standard et contient un ViewPager qui charge les fragments. Les modifications apportées à la disposition Fragment ont provoqué le dysfonctionnement du comportement du show fab.
Voici la mise en page de Fragment de travail d'origine:
<SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/filterMenu"
android:clipToPadding="false" />
</SwipeRefreshLayout>
Voici la nouvelle mise en page de Fragment qui ne fonctionne pas:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/emptyStateView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:translationY="@dimen/home_empty_state_y_offset">
<ImageView
android:id="@+id/emptyStateImage"
android:layout_width="wrap_content"
android:layout_height="160dp"
android:layout_centerInParent="true"
android:src="@drawable/home_empty_state_animation" />
</RelativeLayout>
<SwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/filterMenu"
android:clipToPadding="false" />
</SwipeRefreshLayout>
</FrameLayout>
Il semble que le FrameLayout ajouté provoque ces problèmes, mais je ne suis pas Je ne sais pas pourquoi. Est-ce un problème de conception? ou ai-je oublié quelque chose?
problème fou ... merci de partager cela! –