2017-02-05 5 views
3

Ich habe eine Aktivität mit reduzierenden Symbolleiste erstellt, aber jetzt habe ich eine untere Navigationsansicht mit 3 Menüelementen darin hinzugefügt. aber ich bemerkte, dass der Inhalt der Aktivität sich hinter der unteren Navigationsansicht verbirgt. Wer hat eine Idee? kurz gesagt, die letzten Zeilen meines Inhaltslayouts verstecken sich hinter der unteren Navigationsansicht.BottomNavigationView überlappt den Inhalt-Android

hier ist mein xml Layout:

<?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" 
    xmlns:design="http://schemas.android.com/tools" 
    android:fitsSystemWindows="true"> 

    <android.support.design.widget.AppBarLayout 
     android:id="@+id/appbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:fitsSystemWindows="true" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> 

     <android.support.design.widget.CollapsingToolbarLayout 
      android:id="@+id/collapsing_toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:fitsSystemWindows="true" 
      app:contentScrim="?attr/colorPrimary" 
      app:expandedTitleMarginBottom="32dp" 
      app:expandedTitleMarginEnd="64dp" 
      app:expandedTitleMarginStart="48dp" 
      app:layout_scrollFlags="scroll|exitUntilCollapsed"> 


      <ImageView 
       android:id="@+id/header" 
       android:layout_width="match_parent" 
       android:layout_height="250dp" 
       android:src="@drawable/p1" 
       android:background="@color/colorPrimary" 
       android:fitsSystemWindows="true" 
       android:scaleType="centerCrop" 
       app:layout_collapseMode="parallax" /> 


      <android.support.v7.widget.Toolbar 
       android:id="@+id/anim_toolbar" 
       android:layout_width="match_parent" 
       android:layout_height="?attr/actionBarSize" 
       app:layout_collapseMode="pin" 
       app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> 

       <TextView 
        android:id="@+id/toolbar_title" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:fontFamily="sans-serif-light" 
        android:gravity="center" 
        android:singleLine="true" 
        android:textColor="@android:color/white" 
        android:textSize="18sp" /> 
      </android.support.v7.widget.Toolbar> 
     </android.support.design.widget.CollapsingToolbarLayout> 
    </android.support.design.widget.AppBarLayout> 

    <android.support.v4.widget.NestedScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:clipToPadding="false" 
     android:id="@+id/scroll" 
     android:padding="16dp" 

     android:layout_gravity="fill_vertical" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"> 


    </android.support.v4.widget.NestedScrollView> 
    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <android.support.design.widget.BottomNavigationView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      app:menu="@menu/bottom_menu" 
      android:id="@+id/bottomMenu" 
      android:layout_alignParentBottom="true"/> 

    </RelativeLayout> 

</android.support.design.widget.CoordinatorLayout> 
+0

Ich habe auch das gleiche Problem. Hast du irgendeine Lösung gefunden? – Bhupesh

Antwort

0

Ihre Frage ist nicht klar, ob ich Sie würde vorschlagen, die BottomNavigationView aus dem CoordinateLayout, also halten Sie die Wurzel als RelativeLayout und unter, dass die CoordinateLayout auch halten zu halten als Ihre Ansicht von unten separat und zuweisen alignParentBottom="true" zu ihm.