1. 程式人生 > >Design Support Library詳解

Design Support Library詳解

編輯推薦:稀土掘金,這是一個針對技術開發者的一個應用,你可以在掘金上獲取最新最優質的技術乾貨,不僅僅是Android知識、前端、後端以至於產品和設計都有涉獵,想成為全棧工程師的朋友不要錯過!

導讀:這個相容庫很容易和之前的 Android Support Library 22.1混淆,都是相容庫,區別是這個庫多了個Design。 Android Support Library 22.1只是支援了一些基本控制元件的材料設計化,但是這個庫更多的是對一些特效的實現,這個庫和github上的很多開源專案是有很大關係的,material design的很多效果,同一種效果在github上有太多的實現,現在官方把部分效果標準化了。

安卓5.0是是有有史以來最重要的安卓版本之一,這其中有很大部分要歸功於material design的引入,這種新的設計語言讓整個安卓的使用者體驗煥然一新。我們的詳細專題是幫助你開始採用material design的好去處。但是我們也知道,這種設計對於開發者,尤其是那些在意向後相容的開發者來說是一種挑戰。

在Android Design Support Library的幫助下,我們為所有的開發者,所有2.1以上的裝置,帶來了一些重要的material design控制元件。你可以在這裡面找到navigation drawer view輸入控制元件的懸浮標籤懸浮操作按鈕

snackbar選項卡以及將這些控制元件結合在一起的手勢滾動框架

Navigation View

抽屜導航是app識別度與內部導航的關鍵,保持這裡設計上的一致性對app的可用性至關重要,尤其是對於第一次使用的使用者。 NavigationView 通過提供抽屜導航所需的框架讓實現更簡單,同時它還能夠直接通過選單資原始檔直接生成導航元素。

drawer.png

把NavigationView作為DrawerLayout的內容檢視來使用,比如下面的佈局:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <android.support.v4.widget.DrawerLayout android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <!-- your content layout --> <android.support.design.widget.NavigationView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" app:headerLayout="@layout/drawer_header" app:menu="@menu/drawer"/> </android.support.v4.widget.DrawerLayout>

你會注意到NavigationView的兩個屬性:app:headerLayout  - 控制頭部的佈局, app:menu - 導航選單的資原始檔(也可以在執行時配置)。NavigationView處理好了和狀態列的關係,可以確保NavigationView 

在API21+裝置上正確的和狀態列互動。最簡單的抽屜選單就是幾個可點選的選單集合:

1 2 3 4 5 6 7 8 9 10 11 <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_1" android:checked="true" android:icon="@drawable/ic_android" android:title="@string/navigation_item_1"/> <item android:id="@+id/navigation_item_2" android:icon="@drawable/ic_android" android:title="@string/navigation_item_2"/> </group>

相關推薦

Design Support Library

編輯推薦:稀土掘金,這是一個針對技術開發者的一個應用,你可以在掘金上獲取最新最優質的技術乾貨,不僅僅是Android知識、前端、後端以至於產品和設計都有涉獵,想成為全棧工程師的朋友不要錯過! 導讀:這個相容庫很容易和之前的 Android Support

Android Design Support Library 使用

概述 Android Design Support Library 是Google在2015年的IO大會上,帶來的全新適應Material Design設計規範的支援庫。在這個支援庫中,給我們提供了更加規範的MD設計風格控制元件。重要的是,Android De

使用Android design support library在Eclipse和Android Studio

content mod img span ont tracking details con man 背景:為了在低版本號下使用Android 5.0的一些新特新 Eclipse篇: 1、將Android Manager中的Android support librar

Android Design Support Library(二)用NavigationView實現抽屜菜單界面

mpi tar bar board contex != print 滑動 頭部 NavigationView在MD設計中很重要,之前Google也提出了使用DrawerLayout來實現導航抽屜。這次,在Android Design Support Li

Android Design Support Library介紹之:環境搭建

扁平化 end javascrip 搭建 版本號 mod 開心 log ng- 在2015年的GoogleIO大會上。具體的Material Design設計規範出爐了。全新的Android Design Support Library 格。更讓人

領域驅動設計 Domain Driven Design 參考架構

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

Android Paging library(二)

重要API及原始碼分析 文章目錄 1.重要API介紹 1.1 DataSource 1.2 PageList 1.3 PagedListAdapter 2.原始碼解析 1.重要API介紹 Pagin

Android Paging library(一)

官方文件翻譯 文章目錄 1.概覽 1.1 庫架構 1.2 支援不同的資料架構 1.2.1 網路獲取或者資料庫 1.2.2 網路和資料庫同時獲取 1.2.3 處理網路錯誤 1.2.4 更新

Android 自己實現 NavigationView Design Support Library 1

                     一、概述Google I/O 2015 給大家帶來了Android Design Support Library,對於希望做md風格的app的來說,簡直是天大的喜訊了~大家可以通過Android Design Support Library該文章對其進行了解,也可以直

Codelab for Android Design Support Library used in I/O Rewind Bangkok session

At the moment I believe that there is no any Android Developer who doesn't know about Material Design anymore since it officially becomes

Eclipse下使用Android Design Support Library中的控制元件

我只測試了 Design效果的Login和Scrolling效果控制元件。 最下面奉上2個demo。 1、File\import匯入sdk\extras\android\support\V7\appcompat後,右鍵專案Properties\Android\Is Lib

Android Design Support Library--FloatingActionButton簡析記錄

Android Design Support Library–FloatingActionButton簡析記錄 最近在看FloatingActionButton的使用,FloatingActionButton的呼叫還是很簡單的,先看看下邊的程式碼。 mFloatBtn

Android Design Support Library(一)--TextInputLayout簡析

2015年google IO大會上介紹的Android Design Support Library庫中的八個新控制元件,今天學習了TextInputLayout的簡單使用。 在使用Android Design Support Library庫的時候,只是找到了如何在android su

Android Design Support Library(二)用NavigationView實現抽屜選單介面

NavigationView在MD設計中非常重要,之前Google也提出了使用DrawerLayout來實現導航抽屜。這次,在Android Design Support Library中,Google提供了NavigationView來實現導航選單介面。

Android Design Support Library BottomSheetBehavior使用

本文使用的 com.android.support:design 版本為 23.3.0 效果圖 相關類 BottomSheetBehavior 此類類似一個工具類,並不能在佈局中使用,下面我們看看怎麼實現我們效果圖中的

Android註解支援(Support Annotations)

註解支援(Support Annotations)Android support library從19.1版本開始引入了一個新的註解庫,它包含很多有用的元註解,你能用它們修飾你的程式碼,幫助你發現bug。Support library自己本身也用到了這些註解,所以作為supp

Eclipse下使用Android Design Support Library中的控制元件(比如TabLayout)

eclipse報錯: android.support.design.widget.Snackbar找不到(需要design專案) android.support.design.widget.Fl

Design Support Library(支撐Material Design)

本篇部落格主要記錄一下Design Support Library中控制元件的基本使用方式。 Design Support Library是一個相容函式庫,使得開發者可以 在Android 2.1及以上的裝置中實現Material Design的效果。

Support Annotation Library使用

概述 Support Annotation Library是在Android Support Library19.1版本開始引入的一個全新的函式包,它包含了諸多有用的元註解。用來幫助開發者在編譯期間發現可能存在的bug。Support Library本身也使用

Android進階系列之Support Annotation Library使用

Android Support Library 發展到現在已經不止是一個jar包了,而是拆分成多個獨立的Jar包,例如support-v4、support-v7、gridlayout-v7、design、cardview-v7等等。而Annotation Libary 也是其中之一,預設情況下是不會包含在工