2

Nach dem Einfügen des Coordinator-Layouts in mein Projekt habe ich ein Problem. Ich werde mein Layout veröffentlichen.Koordinatorlayout verschiebt Inhalte auf der Höhe eines AppbarLayouts

Hier ist meine main_layout.xml:

<android.support.design.widget.CoordinatorLayout 
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:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     app:layout_scrollFlags="scroll|enterAlways"/> 

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

<LinearLayout 
    android:id="@+id/frame_content_keeper" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:orientation="vertical"> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Top Text"/> 
    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/login_buttons" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="0" 
     android:orientation="horizontal"> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Bottom text"/> 
    </LinearLayout> 
</LinearLayout> 
</android.support.design.widget.CoordinatorLayout> 

enter image description here

Ich sehe Textview nicht mit 'Bottom Text'. Sieht so aus wie unter dem Bildschirm. Ich denke, es ist ein Defekt.

Antwort

4

Es ist normal, weil Sie diese Zeile

App entfernen sollte: layout_scrollFlags = "scroll | enterAlways"

von Ihrem

android.support.v7.widget.Toolbar

Dieses Attribut ist für w Wenn Sie eine Liste haben und wenn Sie nach unten scrollen, wird die Aktionsleiste

verstecken