设为首页 加入收藏

TOP

Android Launcher3应用列表修改透明背景
2015-07-16 12:55:07 来源: 作者: 【 】 浏览:2
Tags:Android Launcher3 应用 修改 透明 背景

将launcher3的应用列表背景修改为透明,与Launcher2略有不同,需要进行如下步骤:


1. 找到res/layout/apps_customize_pane.xml文件,将


修改为:


xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="#00000000">


将动画部分


android:id="@+id/animation_buffer"
?android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF000000"
android:visibility="gone" />


修改为:


android:id="@+id/animation_buffer"
?android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
android:visibility="gone" />


2、找到AppsCustomizeTabHost.java类中的onTabChangedEnd()方法,如下:


?private void onTabChangedEnd(AppsCustomizePagedView.ContentType type) {
? ? ? ? int bgAlpha = (int) (255 * (getResources().getInteger(
? ? ? ? ? ? R.integer.config_appsCustomizeSpringLoadedBgAlpha) / 100f));
? ? ? ? setBackgroundColor(Color.argb(bgAlpha, 0, 0, 0));
? ? ? ? mAppsCustomizePane.setContentType(type);
? ? }



其中bgAlpha为透明度的参数,将其改为你需要的透明度即可,255为不透明,以上1、2步骤完之后,保存,编译,即可达到需要的效果。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Singleton单例模式 下一篇二叉树遍历(图解)

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: