2016-03-31 11 views
0

この機能を使用しているアプリケーションの多くは、スクロールするときにアクションバーが写真とやりとりするGoogle Playストアから始まっていますが、その内容や適用方法、使用する要素はわかりません。アンドロイドでこの機能は何と呼ばれていますか?

enter image description here

enter image description here

enter image description here

+0

このStackOverflowの答えは、私が思うに、それをカバーするようです。 http://stackoverflow.com/questions/25424818/how-to-make-a-actionbar-like-google-play-that-fades-in-when-scrolling –

+1

[Design Support Libraryでのツールバーレイアウトの折りたたみ](http ://android-developers.blogspot.co.uk/2015/05/android-design-support-library.html) – PPartisan

+0

すばらしい返答をいただきありがとうございます。これが私が探していたものです。 –

答えて

0

それはCollapsingToolbarLayoutです。ここで

this linkから抽出された例です。

<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/app_bar_layout" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     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" 
      app:layout_scrollFlags="scroll|exitUntilCollapsed" 
      app:contentScrim="?attr/colorPrimary" 
      app:expandedTitleMarginStart="48dp" 
      app:expandedTitleMarginEnd="64dp" 
      android:fitsSystemWindows="true"> 

      <com.antonioleiva.materializeyourapp.SquareImageView 
       android:id="@+id/image" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:scaleType="centerCrop" 
       android:fitsSystemWindows="true" 
       app:layout_collapseMode="parallax"/> 

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

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

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

</android.support.design.widget.CoordinatorLayout> 
関連する問題