1. 程式人生 > >CoordinatorLayout、AppBarLayout與CollapsingToolbarLayout運用

CoordinatorLayout、AppBarLayout與CollapsingToolbarLayout運用

<android.support.design.widget.AppBarLayout 
 android:id="@+id/school_appbar" 
 android:layout_width="match_parent" 
 android:layout_height="wrap_content"
 android:background="@color/white">  
     <android.support.design.widget.CollapsingToolbarLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"  
      app:expandedTitleMarginStart="1dp"   
     app:layout_scrollFlags="scroll|exitUntilCollapsed"> 
	<LinearLayout 
	 android:layout_width="match_parent"  
	 android:layout_height="wrap_content" 
	 android:orientation="vertical">	
	   //這裡面放要在頭部顯示的內容      
	</LinearLayout> 
 
	<android.support.v7.widget.Toolbar  
	   android:id="@+id/school_toolbar"  
	   android:layout_width="match_parent" 
	   android:layout_height="40dp"    
	   app:layout_scrollFlags="scroll|enterAlways" 
	   app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
	   android:background="@color/white" 
	   app:layout_collapseMode="pin" > 
	        <RelativeLayout    
	            android:layout_width="match_parent"  
	            android:layout_height="40dp">
	            //頭隱藏之後要顯示的內容 
	        </RelativeLayout>  
	</android.support.v7.widget.Toolbar> 
   </android.support.design.widget.CollapsingToolbarLayout>  
     <android.support.design.widget.TabLayout  
        android:id="@+id/school_tab"  
	style="@style/MyTabLayoutTextAppearance"  
	android:layout_width="match_parent"
	android:layout_height="44dp"	
	//內容在Toolbar下面           /> 
</android.support.design.widget.AppBarLayout>

相關推薦

CoordinatorLayoutAppBarLayoutCollapsingToolbarLayout運用

<android.support.design.widget.AppBarLayout   android:id="@+id/school_appbar"   android:layout_wi

RecyclerViewCoordinatorLayoutAppBarLayoutCollapsingToolbarLayout 解決上滑到toolbar卡頓

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.SwipeRefreshLayout android:id="@id/contentView" android:layout

UI之CoordinatorLayoutAppbarLayoutCollapsingToolbarLayout的使用

1.CoordinatorLayout 是什麼 CoordinatorLayout 是一種功能更強大的FrameLayout 主要用於: 1.作為window的頂層佈局 decor 2.作為父容器排程協調子佈局,通過設定子View的 Behavior來

android5.0協調佈局CoordinatorLayout(第一篇CoordinatorLayoutAppBarLayoutCollapsingToolbarLayout之間的關係詳解)原理

首先從協調佈局最簡單的例子為入口開始分析,由淺到深,看效果圖: 此效果如果不用5.0以下的自定義的效果的話,相對麻煩很多,而用5.0的協調佈局的話只需要簡單的寫一個佈局檔案就搞定了,看佈局檔案程式碼 <android.support.design.widget.C

CoordinatorLayoutAppBarLayout的用法

CoordinatorLayout其實是加強版的FrameLayout佈局,可以監聽期所有子控制元件的各種事件,由Design Support庫提供的,能體現Material Design 的魔力。能解決其子控制元件互相遮擋問題。所以,當Toolbar控制元件與RecycledView控制元件互相時,所以要放

【Android】Material Design 之四 五 六 AppBarLayoutCoordinatorLayoutCollapsingToolbarLayout使用

一、AppBarLayout AppBarLayout是繼承自LinearLayout,預設是垂直方向,可以看成是一個垂直方向的線性佈局,其作用是將APPBarLayout包裹的內容都作為AppBar,支援手勢滑動。 AppBarLayout必須作為Toolbar的父佈局

19SOAP安裝,運用比對結果解釋

轉載:http://www.dengfeilong.com/post/Soap2.html https://blog.csdn.net/zhu_si_tao/article/details/71108344 軟體下載網址:http://soap.genomics.org.cn/down/SOAPaligner

Oracle12c多租戶如何連接到CDB或PDBCDBPDB容器切換

說明 sel ica 顯示數據 protoc oracl pro 其他 order by Oracle 數據庫 12 c 多租戶選項允許單個容器數據庫 (CDB) 來承載多個單獨的可插拔數據庫 (PDB)。那麽我們如何連接到容器數據庫 (CDB) 和可插拔數據庫 (PDB)

語法語義哲學

alt blog 都對 含義 技術 png logs tail 自然 語法:語言要素組成語句的規則;是部分如何和成整體的原則; 物質的組成規則。 語義:描述的是信息流通的過程;本質是信息的可理解性。 http://www.juweixin.com/t/detail/

快速入門系列--WCF--07傳輸安全授權審核

最大的 緩存 ims cut 常見 曾經 strong 這一 set 這部分主要涉及企業級應用的安全問題,一般來說安全框架主要提供3個典型的安全行為:認證、授權和審核。除了典型的安全問題,對於一個以消息作為通信手段的分布式應用,還需要考慮消息保護(Message Prote

快速入門系列--WCF--02消息會話服務寄宿

abc align bsp 不同的 cpu .org 程序 伸縮 網絡 經過WCF基礎的ABC學習,已經可以構建簡單的WCF的服務,使用不同的服務地址和綁定類型,根據業務提供所需的服務契約。但不禁想問,服務所使用的消息報文是什麽樣的形式麽?蘊含什麽樣內容呢?WCF服務是否支

StringStringBufferStringBuilder之間區別 .RP

什麽 方式 tr1 abcd 為什麽 mes strong 速度 一點   最近學習到StringBuffer,心中有好些疑問,搜索了一些關於String,StringBuffer,StringBuilder的東西,現在整理一下。 關於這三個類在字符串處理中的位置不言而喻,

利用jquery mobiscroll插件選擇日期selecttreeList的具體運用

order 移動 cancel fault ons val margin image ios mobiscroll是個很好用的用於移動端滑動選擇的插件,可以用來選擇日期,也可以用來選擇簡單選項或者一些復雜的樹形結構的選項,簡單分享下。 依賴也比較簡單,引入一個mob

AppletScriptletServlet

規模 stop ros 有著 解釋執行 抽象類 選擇 con 用戶輸入 Applet、Scriptlet與Servlet - 青春念邵的博客 - 博客頻道 - CSDN.NEThttp://blog.csdn.net/mo_fan_qing_wa/article/detai

linux命令的排列替換別名

data- 定義 div nbsp 命令 空格 con 接下來 是否 命令的排列; 1、使用“;” 命令語法: 命令1;命令2 當運行該命令時,無論命令1是否出錯。接下來就運行命令2 2、使用“&&” 命令語法:命令1&&命令2 當運行該

Linux input子系統編程分析模板

linux輸入設備都有共性:中斷驅動+字符IO,基於分層的思想,Linux內核將這些設備的公有的部分提取出來,基於cdev提供接口,設計了輸入子系統,所有使用輸入子系統構建的設備都使用主設備號13,同時輸入子系統也支持自動創建設備文件,這些文件采用阻塞的IO讀寫方式,被創建在"/dev/input/"下。如下

FtpFtpsSftp之間的區別

進行 down 不同的 在那 用戶目錄 方案 重要 新的 信息安全 Ftp FTP 是File Transfer Protocol(文件傳輸協議)的英文簡稱,而中文簡稱為“文傳協議”。用於Internet上的控制文件的雙向傳輸。同時,它也是一個應用程序(Applicatio

PYTHON REQUESTS的安裝簡單運用

Coding import out compile 鏈接 客戶端 detail 但我 編輯 PYTHON REQUESTS的安裝與簡單運用 2013.07.09 強烈推薦!requests官方文檔已有了中文版,請見http://cn.python-requests.o

分布式緩存技術redis學習系列(三)——redis高級應用(主從事務持久化)

master ica not ood www working can 出了 owin 上文《詳細講解redis數據結構(內存模型)以及常用命令》介紹了redis的數據類型以及常用命令,本文我們來學習下redis的一些高級特性。 回到頂部 安全性設置 設置客戶端操作秘密

StringStringBufferStringBuilder之間區別

安全 .com 學習 ron img build tro ges 變量   大家在最初結束String字符串的時候,都會被教做認為String是不可變的字符串常量,是不可改變的常量。但是我們看下面的一個列子:   為什麽會發生這種情況呢?難道最開始我們學習的就是錯誤的?