1

CollapsingToolbarLayoutのレイアウトでNestedScrollViewに問題があります。最後の文章を下にスクロールすると、ナビゲーションバーが表示されます。NestedScrollViewの下部がナビゲーションバーで隠されています[Android]

enter image description here
layout.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.design.widget.AppBarLayout 
     android:id="@+id/appBar" 
     android:layout_width="match_parent" 
     android:layout_height="250dp" 
     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" 
      app:contentScrim="?attr/colorPrimary" 
      app:expandedTitleTextAppearance="@style/ExpandedAppBar" 
      app:layout_scrollFlags="scroll|exitUntilCollapsed" 
      app:title="Title"> 

      <ImageView 
       android:id="@+id/toolbar_image_view" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:scaleType="centerCrop" 
       android:src="@drawable/visit_at_office" 
       app:layout_collapseMode="parallax" /> 

      <android.support.v7.widget.Toolbar 
       android:id="@+id/toolbar" 
       android:layout_width="match_parent" 
       android:layout_height="?attr/actionBarSize" 
       app:layout_collapseMode="pin" /> 

     </android.support.design.widget.CollapsingToolbarLayout> 

    </android.support.design.widget.AppBarLayout> 

    <android.support.v4.widget.NestedScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:fitsSystemWindows="true" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

     <TextView 
      android:id="@+id/textView" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/lorem_ipsum" /> 
    </android.support.v4.widget.NestedScrollView> 
    </android.support.design.widget.CoordinatorLayout> 

のTextViewにマージン底を追加するには、このバグを修正したが、私は任意のより良い解決策を知りたいのですが、なぜそれが起こるのです。誰も助けてくれませんか?

答えて

0

のルートレイアウトにandroid:fitsSystemWindows="true"を追加しました。

この行は、ビューを全画面に合わせます。

関連する問題