![](/img/trans.png)
[英]How can I put notification icon in notification area while app is running android?
[英]How can i convert an image to notification icon to use in android app?
我已經嘗試在 android studio 中使用res -> new -> Image Asset內置工具,然后選擇通知圖標。 我已經研究並發現圖像背景應該是透明的才能工作,但這也不起作用。 我也試過推薦的 24x24 大小的圖像,但無法讓圖標在我的 android 應用程序中工作。 在此先感謝您提供任何有用的建議。
對於 v21 及以上版本--> 在通知圖標中,只允許使用白色和透明顏色。 使用您想要顯示的白色,其余部分使其透明。
對於 v20 及以下版本 --> 您可以使用具有適當尺寸的任何圖像。
有關詳細信息,請參閱此處。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.