Android 5.0の新しいコントロールのプロパティの紹介

5388 ワード

CollapsingToolbarLayout                        ToolBar   
    android:id="@+id/collapsing_toolbar"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_scrollFlags="scroll|exitUntilCollapsed"   //
    android:fitsSystemWindows="true"
    app:contentScrim="?attr/colorPrimary"
    app:expandedTitleMarginStart="48dp"
    app:expandedTitleMarginEnd="64dp">
1. Collapsing title:ToolBar   , CollapsingToolbarLayout       ,title       ,       ,title            。     setTitle(CharSequence)    title。
 2. Content scrim:ToolBar             ,     setContentScrim(Drawable)                app:contentScrim=?attr/colorPrimary     。
 3. Status bar scrim:      ,    setStatusBarScrim(Drawable)。      ,       Android5.0       。
 4. Parallax scrolling children:CollapsingToolbarLayout   ,       ,      app:layout_collapseParallaxMultiplier=0.6  。
 5. CollapseMode :        ,   “pin”:    ,             ;“parallax”:    ,                。            app:layout_collapseMode=parallax   。
app:expandedTitleMarginStart="48dp"  //   (   )title       
app:expandedTitleMarginEnd="64dp">   //......       

    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    app:layout_anchor="@id/main_content"   //                
    app:layout_anchorGravity="bottom|right|end"     //                  
    android:src="@android:drawable/ic_btn_speak_now"   //       
    android:layout_margin="15dp"    //  
    app:backgroundTint="#f00"  //   
    app:rippleColor="#ff0"   //      
    app:elevation="10dp"   //    
    app:pressedTranslationZ="20dp"   //    z  

android
:clickable=
"true"
/>