0

Ich setze das minimierende Symbolleisten-Layout ein. Ich habe den Parallax-Modus für das relative Layout unterhalb der Werkzeugleiste eingestellt.Der Parallax-Modus funktioniert nicht beim Minimieren des Symbolleisten-Layouts

Aber es wird nicht verblassen, wenn ich die Symbolleiste nach oben scrollen. Ich zeige nur das relative Layout über dem Titel der Symbolleiste. Es wird mit der Symbolleiste zusammengeführt.

Haben alle Modi noch eingestellt es wird zusammengeführt.

Layout:

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

    <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:layout_scrollFlags="scroll|exitUntilCollapsed" 
     app:titleEnabled="false"> 

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

      <RelativeLayout 
       android:id="@+id/content" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:paddingLeft="30dp" 
       app:layout_collapseMode="parallax" 
       android:layout_gravity="bottom" 
       android:layout_marginBottom="10dp" 
       app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"> 


       <TextView 
        android:id="@+id/eventName" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginTop="20dp" 
        android:text="Event Name" 
        android:textColor="#ffffff" 
        android:textSize="14sp"/> 

       <TextView 
        android:id="@+id/date" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/eventName" 
        android:layout_marginTop="10dp" 
        android:text="Date" 
        android:textColor="#ffffff" 
        android:textSize="14sp"/> 

       <TextView 
        android:id="@+id/time" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/date" 
        android:layout_marginBottom="10dp" 
        android:layout_marginTop="10dp" 
        android:text="Time" 
        android:textColor="#ffffff" 
        android:textSize="14sp"/> 

      </RelativeLayout> 


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

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

<android.support.v4.widget.NestedScrollView 
    android:id="@+id/scroll" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:clipToPadding="false" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior"> 


     <LinearLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_alignParentLeft="false" 
      android:layout_alignParentStart="false" 
      android:layout_below="@+id/textView6" 
      android:layout_marginTop="20dp"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="PLAN" 
       android:layout_centerHorizontal="true" 
       android:textAppearance="@android:style/TextAppearance.Large" 
       android:id="@+id/textView6" 
       android:layout_marginTop="10dp" 
       android:layout_gravity="center_horizontal" /> 
      <Button 
       android:layout_width="150dp" 
       android:layout_height="40dp" 
       style="?android:attr/borderlessButtonStyle" 
       android:text="Schedule" 
       android:id="@+id/schedule" 
       android:layout_gravity="center_horizontal" 
       android:background="@drawable/list_background" 
       android:layout_marginTop="20dp" /> 

      <Button 
       android:layout_width="150dp" 
       android:layout_height="40dp" 
       style="?android:attr/borderlessButtonStyle" 
       android:text="Check List" 
       android:id="@+id/button4" 
       android:layout_gravity="center_horizontal" 
       android:layout_marginTop="20dp" 
       android:background="@drawable/list_background" /> 

      <Button 
       android:layout_width="150dp" 
       android:layout_height="40dp" 
       android:text="Vendors" 
       style="?android:attr/borderlessButtonStyle" 
       android:id="@+id/button5" 
       android:layout_gravity="center_horizontal" 
       android:layout_marginTop="20dp" 
       android:background="@drawable/list_background" /> 

      <Button 
       android:layout_width="150dp" 
       android:layout_height="40dp" 
       android:text="Invitee" 
       style="?android:attr/borderlessButtonStyle" 
       android:id="@+id/button6" 
       android:layout_gravity="center_horizontal" 
       android:layout_marginTop="20dp" 
       android:background="@drawable/list_background" /> 
     </LinearLayout> 


</android.support.v4.widget.NestedScrollView> 

wie folgt aussieht nach dem Scrollen nach oben:

enter image description here

Was ist los?

Bitte Danke helfen ..

+0

hinzufügen _CoordinatorLayout_ als Eltern-Layout. – Piyush

+0

Können Sie Bildschirm teilen. –

+0

Ich habe das Layout des Koordinators als übergeordnetes Layout hinzugefügt, weiß nicht, warum es keinen Beitrag erhält @PiyushGupta –

Antwort

2

Try enterAlways von Ihrem Relative Layout zu entfernen.

Only use this.

app:layout_scrollFlags="scroll|enterAlwaysCollapsed"> 

Für z Sie LayoutToolBar Below Relative Layout sein sollte.

<RelativeLayout 
      android:id="@+id/image" 
      android:layout_width="match_parent" 
      android:layout_height="250dp" 
      android:background="@drawable/header" 
      android:fitsSystemWindows="true" 
      android:scaleType="centerCrop"> 

      <ImageView 
       android:id="@+id/imageViewPhoto" 
       android:layout_width="80dp" 
       android:layout_height="80dp" 
       android:layout_centerInParent="true" 
       app:layout_collapseMode="parallax" /> 

      <TextView 
       android:id="@+id/textViewName" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentBottom="false" 
       android:layout_below="@+id/imageViewPhoto" 
       android:layout_centerHorizontal="true" 
       android:layout_marginTop="5dp" 
       android:text="TEXT" 
       android:textSize="16dp" /> 

     </RelativeLayout> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:fitsSystemWindows="true" 
      android:gravity="top" 
      app:layout_collapseMode="pin" 
      app:layout_scrollFlags="scroll|enterAlways"> 

      <TextView 
       android:id="@+id/toolbar_title" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:gravity="center" 
       android:textSize="20dp" 
       android:textStyle="bold" /> 
     </android.support.v7.widget.Toolbar> 
+0

habe es. Ich habe Toolbar über dem relativen Layout hinzugefügt, sollte unterhalb des Layouts sein. @jaydroider –

+0

Ja sollte es unter dem 'Tool Bar Layout' sein. –

+0

@ user6265109 Bearbeitete meine Antwort pls verweisen das. –

0

unter der Linie in Ihrem Relative Layout Put:

app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed" 
+0

hinzugefügt. funktioniert immer noch gleich. @ Mehta –