簡體   English   中英

移除 android 啟動器圖標周圍的白色容器

[英]Remove white container around android launcher icons

正如您在我的屏幕截圖中看到的,我的應用程序 (Q2go) 在啟動器圖標周圍有一個白色邊框。 但是,例如,如果我查看“地圖”,則會刪除邊框並顯示整個圖標。

在此處輸入圖像描述

我瀏覽了很多討論,但沒有一個對我有用,因為我既沒有使用 android studio 也沒有使用 Xamarin.Android。 這是一個 Xamarin.Forms 應用程序,因此沒有可用的 android 圖像編輯器(出於某種原因僅適用於 iOS)......或者我只是沒有找到它?

無論如何,我記得很多年前,有一種方法可以強制在沒有容器的情況下渲染圖標(在不同的平台上有所偏差。在 Droid 9 之上,它位於圓角矩形內,不再是圓形......)

無論如何:如何刪除背景上的白色邊框?

[Activity(Label = "Q2go", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

這就是你的做法:

在名為“mipmap-anydpi-v26”的資源中添加文件夾並添加兩個名為:icon.xml 和 icon_round.xml 的 xml。

內容:

圖標.xml:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/launcher_background" />
    <foreground android:drawable="@mipmap/launcher_foreground" />
</adaptive-icon>

icon_round.xml:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/launcher_background" />
    <foreground android:drawable="@mipmap/launcher_foreground" />
</adaptive-icon>

現在在資源下添加另一個文件夾並將其命名為“mipmap-xxxhdpi”並添加兩個圖像(都是您的徽標,都在 cirlce 中並將它們命名為 1.)icon.png 和 2.)launcher_foreground.png。

最后:復制我的主要活動屬性和 BOOM 現在看起來不錯。

和繁榮

只有在使用不同的圖標形狀(例如正方形)時,才會出現白色框架/容器/邊框。 使用默認圖標形狀(圓形),應用程序啟動圖標沒有白框。

請參閱此評論: https ://support.google.com/pixelphone/thread/9664943?hl=en&msgid=10108242

僅當圖標形狀不是圓形時,Android才會啟動帶有白框的圖標

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM