修改Launcher2欢迎页面字符重叠

相关文件:

位置坐标文件:

sdk-4.1.1/device/rockchip/rk2928sdk/overlay/packages/apps/Launcher2/res/values-sw480dp-land/dimens.xml

水平布局文件:

sdk-4.1.1/device/rockchip/rk2928sdk/overlay/packages/apps/Launcher2/res/layout-sw480dp/workspace_cling.xml

垂直布局文件:

sdk-4.1.1/device/rockchip/rk2928sdk/overlay/packages/apps/Launcher2/res/layout-sw480dp-port/workspace_cling.xml

问题描述:

在水平放置机器时,提示应用程序的字符串与欢迎字符串重叠

分析问题:

将提示应用程序的字符串向上移动,将欢迎字符向下移动,拉开距离即可。

修改步骤如下:

1. 查看sdk-4.1.1/device/rockchip/rk2928sdk/overlay/packages/apps/Launcher2/res/layout-sw480dp/workspace_cling.xml

关键属性:

android:layout_marginTop="@dimen/cling_text_block_offset_y
将以下属性改为:
android:layout_marginTop="5dp"

<com.android.launcher2.Cling
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
    launcher:drawIdentifier="workspace_large">
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="@dimen/cling_text_block_offset_x"  //左间距
        android:layout_marginTop="@dimen/cling_text_block_offset_y">  //顶间距
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <TextView
                style="@style/ClingTitleText"
                android:text="@string/workspace_cling_title" />
            <TextView
                style="@style/ClingText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/workspace_cling_move_item" />
            <Button
                style="@style/ClingButton"
                android:layout_marginTop="15dp"
                android:onClick="dismissWorkspaceCling" />
        </LinearLayout>
    </FrameLayout>
    <TextView
        style="@style/ClingText"
        android:layout_width="180dp"                              //提示信息的宽度
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"                            //顶间距
        android:layout_marginRight="130dp"
        android:layout_gravity="right"
        android:gravity="right"
        android:text="@string/workspace_cling_open_all_apps" />
</com.android.launcher2.Cling>

2. 在 sdk-4.1.1/device/rockchip/rk2928sdk/overlay/packages/apps/Launcher2/res/values-sw480dp-land/dimens.xml 查找
cling_text_block_offset_y,修改如下:
    <dimen name="cling_text_block_offset_x">140dp</dimen>
    <dimen name="cling_text_block_offset_y">100dp</dimen>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值