Eines meiner Projekte verwendet eine gemeinsame Verhaltensklasse zu verbergen/zeigen die Fab-Schaltfläche, die perfekt funktioniert. Nun, um einige Layout-Anforderungen zu ändern, funktioniert die Show Fab auf Scroll-up nicht.FloatingActionButton scroll bewusst Probleme mit RecyclerView in FrameLayout
Das CoordinatorLayout-Setup ist Standard und enthält einen ViewPager, der Fragmente darin lädt. Die Änderungen am Fragment-Layout haben dazu geführt, dass das Fab-Show-Verhalten nicht mehr korrekt funktioniert.
Hier ist das ursprüngliche Arbeits Fragment Layout:
<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>
Hier ist das neue Fragment-Layout, das nicht funktioniert:
<?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>
wie
Es scheint, Das hinzugefügte FrameLayout verursacht diese Probleme, aber ich bin nicht t sicher warum. Ist das ein Designproblem? oder verpasse ich etwas?
verrücktes Problem ... Danke für das Teilen! –