本篇內(nèi)容介紹了“Android開發(fā)怎么實現(xiàn)Launcher3應(yīng)用列表修改透明背景”的有關(guān)知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
具體如下:
Launcher時開機完成后第一個啟動的應(yīng)用,用來展示應(yīng)用列表和快捷方式、小部件等。Launcher作為第一個(開機后第一個啟動的應(yīng)用)展示給用戶的應(yīng)用程序,其設(shè)計的好壞影響到用戶的體驗,甚至影響用戶購機的判斷。所以很多品牌廠商都會不遺余力的對Launcher進(jìn)行深度定制,如小米的MIUI、華為的EMUI等。Android默認(rèn)的Launcher沒有過多的定制,更加簡潔,受到源生黨的追捧,Google的Nexus系列手機基本都是用的源生Launcher,目前Android源生的Launcher版本是Launcher3。
前面總結(jié)了一些常見的launcher3配置修改方法,這里來分析一下launcher3的應(yīng)用列表背景的修改技巧。
將launcher3的應(yīng)用列表背景修改為透明,與Launcher2略有不同,需要進(jìn)行如下步驟:
1. 找到res/layout/apps_customize_pane.xml文件,將
<com.android.launcher3.appscustomizetabhost xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher" android:background="#FF000000">
修改為:
<com.android.launcher3.appscustomizetabhost xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher" android:background="#00000000">
將動畫部分
<frameLayout android:id="@+id/animation_buffer" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FF000000" android:visibility="gone" />
修改為:
<frameLayout 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為透明度的參數(shù),將其改為你需要的透明度即可,255為不透明,以上1、2步驟完之后,保存,編譯,即可達(dá)到需要的效果。
“Android開發(fā)怎么實現(xiàn)Launcher3應(yīng)用列表修改透明背景”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!
網(wǎng)頁標(biāo)題:Android開發(fā)怎么實現(xiàn)Launcher3應(yīng)用列表修改透明背景-創(chuàng)新互聯(lián)
標(biāo)題URL:http://jinyejixie.com/article32/psgsc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站、網(wǎng)站制作、關(guān)鍵詞優(yōu)化、定制網(wǎng)站、做網(wǎng)站、外貿(mào)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)