2016-11-27 7 views
1

ich ein Problem mit dem Tablelayout bin, die hinter dem navigationbar gehen wird, wie Sie sehen:Tablelayout geht hinter Navigationsleiste

All rows are given a weight of 1, as you see thursday row is smaller meaning it goes behind NavBar

Die beiden Laschen ein viewPager haben, der das Fragment-Layout (Tablelayout) enthält:

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
> 
<TableRow 
    android:layout_weight="1"> 
    <TextView 
     android:layout_weight="1" 
     android:text="/" 
     android:textAlignment="center" 
     android:background="@color/colorAccent" 
     /> 
    <TextView 
     android:layout_weight="1" 
     android:text="8-9" 
     android:textAlignment="center"/> 
    <TextView 
     android:layout_weight="1" 
     android:text="9-10" 
     android:textAlignment="center"/> 
    <TextView 
     android:layout_weight="1" 
     android:text="10-11" 
     android:textAlignment="center"/> 
    <TextView 
     android:layout_weight="1" 
     android:text="11-12" 
     android:textAlignment="center"/> 
</TableRow> 
<TableRow 
    android:layout_weight="1" 
    android:background="@color/colorAccent" 
    > 
    <TextView android:text="Sunday" 
     android:gravity="center_horizontal" 
     /> 
</TableRow> 
<TableRow 
    android:layout_weight="1" 
    > 
    <TextView android:text="Monday" 
     android:gravity="center_horizontal"/> 
</TableRow> 
<TableRow 
    android:layout_weight="1" 
    android:background="@color/colorAccent" 
    > 
    <TextView android:text="Tuesday" 
     android:gravity="center_horizontal" 
     /> 
</TableRow> 
<TableRow 
    android:layout_weight="1"> 
    <TextView android:text="Wednesday" 
     android:gravity="center_horizontal"/> 
</TableRow> 
<TableRow 
    android:layout_weight="1" 
    android:background="@color/colorAccent" 
    > 
    <TextView android:text="Thursday" 
     android:gravity="center_horizontal" 
     /> 
</TableRow> 

Und das ist der viewPager:

<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.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
    > 

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

    <android.support.design.widget.TabLayout 
     android:id="@+id/tabs" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:tabMode="fixed" 
     app:tabGravity="fill"/> 
</android.support.design.widget.AppBarLayout> 

<android.support.v4.view.ViewPager 
    android:id="@+id/viewpager" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 

+0

Haben Sie eine Lösung zu finden? – Nfear

Antwort

0

Dieses Attribut in Ihrem <CoordinatorLayout/>

android:fitsSystemWindows="true" 
+0

versuchte es, immer noch nicht funktioniert. –

Verwandte Themen