本篇文章給大家分享的是有關(guān)Android中怎么更改應(yīng)用圖標(biāo),小編覺得挺實(shí)用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。

創(chuàng)新互聯(lián)主打移動(dòng)網(wǎng)站、網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、網(wǎng)站改版、網(wǎng)絡(luò)推廣、網(wǎng)站維護(hù)、國(guó)際域名空間、等互聯(lián)網(wǎng)信息服務(wù),為各行業(yè)提供服務(wù)。在技術(shù)實(shí)力的保障下,我們?yōu)榭蛻舫兄Z穩(wěn)定,放心的服務(wù),根據(jù)網(wǎng)站的內(nèi)容與功能再?zèng)Q定采用什么樣的設(shè)計(jì)。最后,要實(shí)現(xiàn)符合網(wǎng)站需求的內(nèi)容、功能與設(shè)計(jì),我們還會(huì)規(guī)劃穩(wěn)定安全的技術(shù)方案做保障。
Android App更改應(yīng)用的圖標(biāo)的實(shí)現(xiàn)方法
一般情況下,我們App圖標(biāo)在Androidmanifest.xml中設(shè)置,通過Application android:icon屬性指定,寫法如下:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapp"> <application android:name=".ApplicationContext" android:allowBackup="false" android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@style/BaseTheme"> .... ..... </application> </manifest>
因新年來臨等,產(chǎn)品需要針對(duì)最新版本更換一個(gè)應(yīng)用圖標(biāo)。OK,一分鐘搞定,如上,直接替換app_icon.png圖標(biāo)即可。
然而,測(cè)試同學(xué)發(fā)現(xiàn),替換圖標(biāo)后,在小米5、華為6plus、樂視樂1S、小米2s、魅族MX5等手機(jī)上應(yīng)用依然顯示以前圖標(biāo)。
取巧處理方法:
通過應(yīng)用入口Activity android:icon屬性重新指定新圖標(biāo)。目前通過測(cè)試,實(shí)測(cè)基本及時(shí)生效(部分機(jī)型自帶主題除外)。寫法如下:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapp"> <application android:name=".core.application.ApplicationContext" android:allowBackup="false" android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@style/BaseTheme"> .... <activity android:name=".activity.MainActivity" android:icon="@drawable/new_app_icon" android:launchMode="singleTop" android:screenOrientation="portrait" android:theme="@style/BaseTheme.SplashScreen" android:configChanges="keyboardHidden|orientation|screenSize"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> ..... </application> </manifest>
通過入口Activity android:icon="@drawable/new_app_icon" 指向新的應(yīng)用圖標(biāo)。
以上就是Android中怎么更改應(yīng)用圖標(biāo),小編相信有部分知識(shí)點(diǎn)可能是我們?nèi)粘9ぷ鲿?huì)見到或用到的。希望你能通過這篇文章學(xué)到更多知識(shí)。更多詳情敬請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
網(wǎng)站題目:Android中怎么更改應(yīng)用圖標(biāo)
URL分享:http://www.chinadenli.net/article36/igpgpg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)公司、企業(yè)建站、靜態(tài)網(wǎng)站、用戶體驗(yàn)、網(wǎng)站設(shè)計(jì)公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)