在android2.2中,launcher的底部被修改成這種模式,有時候修改launcher的時候需要去掉電話和瀏覽器兩項,我們可以在res/layout-port/檔案夾中找到launcher.xml檔案,在其中有以下代碼
<RelativeLayout android:id="@+id/all_apps_button_cluster" android:layout_width="fill_parent" android:layout_height="@dimen/button_bar_height" android:layout_gravity="bottom|center_horizontal" android:paddingTop="2dip" > <com.android.launcher2.HandleView style="@style/HotseatButton" android:id="@+id/all_apps_button" android:layout_centerHorizontal="true" android:layout_alignParentBottom="true" android:src="@drawable/all_apps_button" launcher:direction="horizontal" /> <ImageView android:id="@+id/hotseat_left" style="@style/HotseatButton.Left" android:layout_toLeftOf="@id/all_apps_button" android:src="@drawable/hotseat_phone" android:onClick="launchHotSeat" /> <ImageView android:id="@+id/hotseat_right" style="@style/HotseatButton.Right" android:layout_toRightOf="@id/all_apps_button" android:src="@drawable/hotseat_browser" android:onClick="launchHotSeat" /> </RelativeLayout>
下面的兩個ImageView控制項就是左右的兩個,一個電話,一個瀏覽器表徵圖,在這裡,你可以把這兩個表徵圖更換為其他功能,當然,具體功能實現得在Launcher.java代碼中實現,如果想去掉這些表徵圖,把上面那段代碼刪除,但是別忘了下面的Launcher.java中的代碼。
hotseatLeft = (ImageView) findViewById(R.id.hotseat_left); hotseatLeft.setContentDescription(mHotseatLabels[0]); hotseatLeft.setImageDrawable(mHotseatIcons[0]); hotseatRight = (ImageView) findViewById(R.id.hotseat_right); hotseatRight.setContentDescription(mHotseatLabels[1]); hotseatRight.setImageDrawable(mHotseatIcons[1]);
屏蔽掉,當然還有他們的聲明代碼。
private ImageView hotseatLeft;
private ImageView hotseatRight;
有關他們的代碼全部屏蔽以後,重新編譯下,完成效果。