CoordinatorLayout / AppBarLayout ExpandableListView wird außerhalb des Bildschirms gerendert
Noch mehr Probleme bei der Verwendung von CoordinatorLayout und AppBarLayout.
Ich versuche, die grundlegende Funktionalität zu erreichen, dass die Symbolleiste beim Scrollen nach unten vom Bildschirm gescrollt wird und beim Scrollen nach oben wieder auf dem Bildschirm angezeigt wird.
Mein aktuelles Setup zeigt jedoch ein Problem: Die Symbolleiste rollt nicht nur nicht ab, sondern die ListView scheint am unteren Bildschirmrand zu rendern. Es ist fast so, als wäre es um die AppBarLayout-Höhe versetzt worden.
Hier ist ein GIF, das das Problem beschreibt. Beachten Sie, dass das letzte Element abgeschnitten ist und die Bildlaufleiste nicht auf dem Bildschirm angezeigt wird:
Mein Layout ist ziemlich normal:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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"
android:background="@color/background">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:background="@color/orange"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeToRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<ExpandableListView
android:id="@+id/listView"
android:groupIndicator="@android:color/transparent"
android:layout_width="match_parent"
android:dividerHeight="0px"
android:layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.design.widget.CoordinatorLayout>