码迷,mamicode.com
首页 > 其他好文 > 详细

Lanucherr 默认显示第几屏

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

标签:des   android   style   http   color   ar   java   sp   strong   

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 默认显示第几屏

标签:des   android   style   http   color   ar   java   sp   strong   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!