35

First Image Second image Third imageEinstürzen Toolbar Layout mit Logo, Titel, Untertitel in Symbolleiste

Ich möchte dies aber mit Symbolleiste Layout Einstürzen oder das Logo und den Titel in Symbolleiste nach Scroll anzuzeigen.

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

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

     <ImageView 
      android:id="@+id/background_image" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:scaleType="centerCrop" 
      android:src="@drawable/background_1" 
      app:layout_collapseMode="parallax" 
      android:fitsSystemWindows="true"/> 

     <RelativeLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:fitsSystemWindows="true"> 

      <ImageView 
       android:id="@+id/avatar_image" 
       android:layout_width="@dimen/circular_image_avatar" 
       android:layout_height="@dimen/circular_image_avatar" 
       android:gravity="center" 
       android:scaleType="centerCrop" 
       android:src="@drawable/ic_placerholder" 
       android:layout_centerVertical="true" 
       android:layout_centerHorizontal="true" 
       android:transitionName="image_toolbar"/> 

      <TextView 
       android:id="@+id/profile_title" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:text="Name title" 
       android:textAlignment="center" 
       android:layout_marginTop="@dimen/item_padding_top_bottom" 
       android:gravity="center" 
       style="@style/titleText_toolbar" 
       android:layout_below="@+id/avatar_image" 
       android:transitionName="title_toolbar"/> 
      <TextView 
       android:id="@+id/profile_subtitle" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:text="Subtitle" 
       android:textAlignment="center" 
       android:gravity="center" 
       style="@style/captionText_toolbar" 
       android:layout_below="@+id/profile_title" /> 

     </RelativeLayout> 

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

      <!-- avatar image and title, subtitle --> 

     </android.support.v7.widget.Toolbar> 

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

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

Bitte helfen Sie mir

+0

Welchen Code haben Sie ausprobiert? Auf welche Probleme stößt du? Beschreibe es mehr und wir werden (wahrscheinlich) helfen. –

+0

http://i.imgur.com/Yj7pe5Y.jpg http://i.imgur.com/AUVokgc.jpg http://i.imgur.com/dqWq3Fp.jpg Leider weiß ich nicht haben 10 Ruf für Post Bilder :( – tonilopezmr

+0

Der Code ist in diesem Fall irrelevant, ich will wissen, wie es geht – tonilopezmr

Antwort

2

smooth-app-bar-Layout

siehe Example

Montage

compile "me.henrytao:smooth-app-bar-layout:<latest-version>" 

enter image description here

enter image description here