设为首页 加入收藏

TOP

Android Launcher View构架浅析
2014-11-24 07:48:42 来源: 作者: 【 】 浏览:0
Tags:Android Launcher View 构架 浅析

1. 先来看一下launcher activity view的架构图(hierarchyviewer.bat工具获取):


launcher view


2. 再来看layout/launcher.xml, layout-port/launcher.xml, layout-land/launcher.xml


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"


android:layout_width="fill_parent"


android:layout_height="fill_parent"


android:background="#FFF">




android:id="@+id/workspace"


android:layout_width="fill_parent"


android:layout_height="fill_parent"


launcher:defaultScreen="1">







android:id="@+id/drawer"


android:layout_width="fill_parent"


android:layout_height="fill_parent"


android:orientation="horizontal"


android:bottomOffset="4dip"


android:handle="@+id/all_apps"


android:content="@+id/content">



android:id="@id/all_apps"


android:layout_width="56dip"


android:layout_height="56dip"


android:background="@drawable/handle"


android:focusable="true"


android:clickable="true"


android:scaleType="center"


android:src="@drawable/handle_icon"


launcher:direction="vertical" />



android:id="@id/content"


android:layout_width="fill_parent"


android:layout_height="fill_parent"


launcher:texture="@drawable/pattern_carbon_fiber_dark"


android:scrollbarStyle="outsideInset"


android:drawSelectorOnTop="false"


android:listSelector="@drawable/grid_selector"


android:nextFocusLeft="@id/all_apps"


android:nextFocusDown="@id/content"


android:nextFocusUp="@id/content"


android:nextFocusRight="@id/content"


android:verticalSpacing="10dip"


android:numColumns="5" />




android:id="@+id/delete_zone"


android:layout_width="49dip"


android:layout_height="wrap_content"


android:scaleType="center"


android:src="@drawable/ic_delete"


android:background="@drawable/delete_zone_selector"


android:layout_marginBottom="-25dip"


android:layout_gravity="right|center_vertical"


android:visibility="gone"


launcher:direction="vertical" />



3. 呈现界面:()


launcher


其中Workspace可增加到任意多个cell,如7个:


launcher:defaultScreen="3">









】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Android VideoView的使用例程 下一篇Linux下Python基础调试

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·PostgreSQL 索引 - (2025-12-25 22:20:43)
·MySQL Node.js 连接 (2025-12-25 22:20:41)
·SQL 撤销索引、表以 (2025-12-25 22:20:38)
·Linux系统简介 (2025-12-25 21:55:25)
·Linux安装MySQL过程 (2025-12-25 21:55:22)