Launcher修改--修改底部图标

在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;
有关他们的代码全部屏蔽以后,重新编译下,完成效果。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值