Android4.0.3 Launcher應用程序圖標放置區域修改

最開始不知道中間那塊區域叫什麼,只知道Lancher中間那塊操作的地方叫做workspace 上網查了後 發現滑動的時候是CellLayout在進行切換,android4.0默認的CellLayout的區域如圖:

基本上已經把整個workspace全佔了,同時有的應用程序安裝運行後會自動生成桌面快捷方式,而且是生成在桌面左上角,如果不對CellLayout進行修改,生成的桌面快捷方式很可能只有一半會顯示出來,所以我就需要對CellLayout的屬性進行修改,找了好久終於找到的修改的地方,修改後的效果如圖:

這樣看起來是不是美觀多了。

具體修改如下:

packages/apps/Launcher2/res/layout-sw600dp/workspace.xml內容如下:

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- The workspace contains 5 screens of cells -->

<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"
    launcher:cellCountX="7"
    launcher:cellCountY="5"
    launcher:pageSpacing="@dimen/workspace_page_spacing">
      <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>
增加了以下兩句
    launcher:cellCountX="7"
    launcher:cellCountY="5"
即限定了x,y軸所存放的應用程序圖標的個數

默認情況下是在這個目錄,有的產家會根據自己的情況進行設置,那個時候就去device目錄下去找了


============================================
作者:hclydao
http://blog.csdn.net/hclydao
版權沒有,但是轉載請保留此段聲明

============================================


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章