3

CoordinatorLayout fügt Leerzeichen zwischen AppBarLayout und RecyclerView hinzu. Nicht sicher, ob es die Toolbar oder AppBarLayout.CoordinatorLayout fügt Platz zwischen AppBarLayout und RecyclerView hinzu

Screenshot des gerenderten Layout am Telefon:

Screenshot of the rendered layout on phone

Der Entwurf auf Studio-Rendering nicht, wie dieser Raum.

Jede Idee, was los ist?

Der Code selbst.

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/activity_home_framelayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:animateLayoutChanges="true" 
    > 

    <android.support.v4.widget.DrawerLayout 
    android:id="@+id/drawer_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:animateLayoutChanges="true" 
    > 

    <android.support.design.widget.CoordinatorLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:app="http://schemas.android.com/apk/res-auto" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:id="@+id/activity_home_coordinator" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true" 
     tools:context=".ActivitySignIn"> 


     <android.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:theme="@style/AppTheme.AppBarOverlay" 
     app:elevation="0dp" 
     > 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="@color/colorPrimary" 
      android:theme="@style/OTGToolbarTheme" 
      > 

      <TextView 
      android:id="@+id/toolbar_title" 
      style="@style/textTitle" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:text="You are logged in" 
      android:textColor="@color/colorAccent"/> 
     </android.support.v7.widget.Toolbar> 

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

     <android.support.v7.widget.RecyclerView 
     android:id="@+id/activity_home_articlecontainer" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:layout_marginTop="0dp" 
     android:background="@color/colorPrimary" 
     android:clipToPadding="false" 
     android:paddingTop="0dp" 
     app:behavior_overlapTop="?attr/actionBarSize" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" 
     /> 
    </android.support.design.widget.CoordinatorLayout> 

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/NavigationDrawer" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:background="@color/colorPrimary" 
     android:scrollbars="vertical" 
     /> 
    </android.support.v4.widget.DrawerLayout> 

    <FrameLayout 
    android:id="@+id/activity_home_overlay" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:clickable="true" 
    android:visibility="gone"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/tlgray0" 
     android:orientation="vertical"/> 

    <ProgressBar 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:indeterminate="true"/> 
    </FrameLayout> 
</FrameLayout> 

Antwort

3

unterhalb der Linie von Ihrer ersten Recycler Ansicht entfernen, welche id activity_home_articlecontainer

android:layout_gravity="start" 
+1

Dank ist! das hat funktioniert. Irgendeine Idee warum? – ThinkingMonkey

Verwandte Themen