Ich habe einen seltsamen Bug in meinem Layout und ich kann es nicht herausfinden. Ein weißer Balken erscheint zwischen meinen Fragmenten und TabLayout. Ich habe diesen Code für eine Weile nicht geändert, vielleicht ist es etwas in Android 6.0.1 (ich habe ein Nexus 5). Ich bin mir ziemlich sicher, dass es in 6.0 oder in Lollipop keinen Bug gab. HierSeltsame weiße Balken erscheint zwischen TabLayout und Fragment
ist ein Screenshot:
Dies ist meine Aktivität XML:
<?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:fitsSystemWindows="true">
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_below="@+id/tablayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="142dp"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginStart="48dp"
app:expandedTitleMarginBottom="20dp"
app:expandedTitleMarginEnd="48dp"
app:expandedTitleTextAppearance="@style/ExpandedText"
app:collapsedTitleTextAppearance="@style/CollapsedText">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_collapseMode="pin"/>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
android:id="@+id/tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar"
android:minHeight="?attr/actionBarSize"
android:gravity="bottom"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:tabIndicatorColor="?attr/colorPrimaryDark"/>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
Jede Idee?
UPDATE 1:
Nach dem Vorschlag von @Abanoub Samaan mein Layout sieht wie folgt aus:
UPDATE 2:
Der Fehler erscheint auch auf meiner Nexus 7 (2012) mit Android 5.1.1 Lollipop.
es nicht funktioniert, sehen Sie das Update in meiner Frage. – zkminusck
Versuchen Sie, die TabLayout-Höhe auf "? Attr/actionBarSize" zu setzen, nicht auf "wrap_content" –
Die Höhe der Symbolleiste ist im Moment auf "? Attr/actionBarSize" eingestellt. – zkminusck