首页 > 其他 > 详细

Lanucherr 默认显示第几屏

时间:2014-11-02 22:31:08      阅读:286      评论:0      收藏:0      [点我收藏+]

Launcher.java

static final int SCREEN_COUNT = 5;
static final int DEFAULT_SCREEN = 2;//第一页是从0开始计数,这里是把第三个页面作为默认首页

launcher.xml

 

  <com.android.launcher2.Workspace  

android:id="@+id/workspace"  

android:layout_width="match_parent"  

android:layout_height="match_parent"  

android:scrollbars="horizontal"  

android:fadeScrollbars="true"  

launcher:defaultScreen="2"

workspace.java

 

mDefaultScreen = a.getInt(R.styleable.Workspace_defaultScreen, 1); 

workspace.xml

<com.android.launcher2.Workspace
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
    android:paddingTop="@dimen/workspace_content_large_only_top_margin"
    launcher:defaultScreen="2"                         修改默认HOME屏
    launcher:pageSpacing="@dimen/workspace_page_spacing">

 

workspace的布局如下:
 

 

(0,0)
(1,0)
(2,0)
(3,0)
(4,0)
(0,1)
(1,1)
(2,1)
(3,1)
(4,1)
(0,2)
(1,2)
(2,2)
(3,2)
(4,2)

Lanucherr 默认显示第几屏

原文:http://www.cnblogs.com/robertsun/p/4070031.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!