_launcher.xml中的結構

來源:互聯網
上載者:User

本文來自http://blog.csdn.net/chenshaoyang0011 轉載請申明文章出處。

Android系統的一大特色是它擁有的案頭通知系統,不同於IOS的案頭管理,Android有一個案頭系統用於管理和展示APP以及案頭Widget等。Android提供一個預設的案頭應

用,當然我們也可以使用第三方的案頭應用。Android的Launcher的源碼在  \packages\apps\Launcher2。Launcher2的主布局檔案包括res\layout-land\launcher.xml

 , res\layout-port\launcher.xml , res\layout-sw600dp\launcher.xml ,分別適配橫屏,豎屏和7寸平板。內容大同小異,這裡就以res\layout-port\launcher.xml的為例。

首先讓我們看看launcher.xml中的結構:

[html]  view plain copy <com.android.launcher2.DragLayer       xmlns:android="http://schemas.android.com/apk/res/android"       xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"       android:id="@+id/drag_layer"       ...       >          <!-- Keep these behind the workspace so that they are not visible when            we go into AllApps -->       <include           android:id="@+id/dock_divider"       layout="@layout/workspace_divider"           ...        />          <!-- 分頁指標 -->       <include           android:id="@+id/paged_view_indicator"           layout="@layout/scroll_indicator"           ...        />          <!-- The workspace contains 5 screens of cells -->       <com.android.launcher2.Workspace           android:id="@+id/workspace"           ...           >              <!-- 五個分屏,預設顯示cell3 -->           <include android:id="@+id/cell1" layout="@layout/workspace_screen" />           <include android:id="@+id/cell2" layout="@layout/workspace_screen" />           <include android:id="@+id/cell3" layout="@layout/workspace_screen" />           <include android:id="@+id/cell4" layout="@layout/workspace_screen" />           <include android:id="@+id/cell5" layout="@layout/workspace_screen" />       </com.android.launcher2.Workspace>          <!-- 搜尋方塊/刪除框 -->       

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.