BottomNavigationView blendet beim scrollen nach oben statt nach unten

Den neuen BottomNavigationView von der Unterstützung der Bibliothek v25.0.0 ist soll ausgeblendet werden, wenn Sie nach unten scrollen, um zu sehen, alle Elemente aus einer Liste. Jedoch, in meinem Test-Szenario, der Ansicht ausgeblendet, wenn das scrollen nach oben. Irgendwelche Ideen, was kann die Ursache für dieses umgekehrte Verhalten?

Den inner_fragment ist als ein Fragment eingefügt in der activity_main_framelayout_content Framelayout. XML-layouts unter:

main_activity.xml:

<android.support.design.widget.CoordinatorLayout
        android:id="@+id/activity_main_coordinatorlayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
            android:id="@+id/activity_main_appbarlayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

        <android.support.v7.widget.Toolbar
                android:id="@+id/activity_main_toolbar"
                android:layout_height="?attr/actionBarSize"
                android:layout_width="match_parent"
                android:background="?attr/colorPrimary"
                app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                app:layout_scrollFlags="scroll|enterAlways">

            <include layout="@layout/activity_main_spinner_layout"/>
        </android.support.v7.widget.Toolbar>
    </android.support.design.widget.AppBarLayout>

    <FrameLayout
            android:id="@+id/activity_main_framelayout_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            android:fitsSystemWindows="true"/>
</android.support.design.widget.CoordinatorLayout>

<android.support.design.widget.NavigationView
        android:id="@+id/activity_main_framelayout_navigation_drawer"
        android:layout_width="@dimen/drawer_width"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        android:background="@color/color_black_700"/>

inner_fragment.xml:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             xmlns:app="http://schemas.android.com/apk/res-auto"
             android:layout_width="match_parent"
             android:layout_height="match_parent">

    <FrameLayout
            android:id="@+id/inner_fragment_framelayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    <android.support.design.widget.BottomNavigationView
            android:id="@+id/inner_fragment_bottom_navigation_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            app:menu="@menu/inner_fragment"
            app:itemBackground="@drawable/bg_bottom_navigation"
            app:itemIconTint="@color/ic_bottom_navigation"
            app:itemTextColor="@color/ic_bottom_navigation"/>
</FrameLayout>
  • Sollten Sie die BottomNavigationView als direktes Kind von CoordinatorLayout. Auch aus meinen versuchen, ich denke, das Verhalten wird nicht unterstützt, jetzt für BottomNavigationView, oder Sie implementieren sollten, Ihrem eigenen Verhalten.
  • Das Verhalten ganz offensichtlich funktioniert, auch wenn es nicht direkt untergeordnet ist, wie es wäre, nicht scrollen, wenn es nicht. Auch NestedScrollview ist, die nicht direkte Kinder des CoordinatorLayout noch einwandfrei funktioniert, also denke ich nicht das das problem ist.
  • Nein, es ist nicht unterstützt app:layout_scrollFlags="scroll|enterAlways"
  • Die BottomNavigationView reagiert auf scroll-Ereignisse auch ohne Einstellung der scrollFlags. Einstellung der flags ändert sich nichts.
  • Wie haben Sie die Arbeit, um dieses @BogdanZurac? Ich habe genau die gleiche situation.
  • Hörer auf das AppBarLayout und verschieben der BottomNavigationView innerhalb der main-layout, soweit ich mich erinnere.
  • Danke @BogdanZurac, ich werde versuchen, es umzusetzen, dass die Art und Weise.

InformationsquelleAutor Bogdan Zurac | 2016-10-21
Schreibe einen Kommentar