ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

关于Android Studio Image Asset 选项,设置app icon

2021-05-19 10:01:18  阅读:216  来源: 互联网

标签:icons launcher Image API Studio device adaptive Android icon


在Android Studio,通过 Image Asset 选项可以设置ic_launcher. 今天用了之后发现低等级的API并不能正确设置 app icon。阅读文档发现 adaptive icon的概念在8.0被提出。


附上原文。
Android 8.0 (API level 26) introduces adaptive launcher icons, which can display a variety of shapes across different device models. For example, an adaptive launcher icon can display a circular shape on one OEM device, and display a squircle on another device. Each device OEM provides a mask, which the system then uses to render all adaptive icons with the same shape. Adaptive launcher icons are also used in shortcuts, the Settings app, sharing dialogs, and the overview screen.

You can control the look of your adaptive launcher icon by defining 2 layers, consisting of a background and a foreground. You must provide icon layers as drawables without masks or background shadows around the outline of the icon.


文中提到新的定义中App icon有两层,例如底层设置一层底色,上层设置一个图标,这样不同的设备可以根据需要裁剪成需要的形状不管是方形或是圆形,我们常见不同规格的图标。

在另外一个链接有如下信息。
 A legacy launcher icon is a graphic that represents your app on a device's home screen and in the launcher window. Legacy launcher icons are intended for use on devices running Android 7.1 (API level 25) or lower, which don't support adaptive icons, and don't display as varying shapes across device models.


adaptive icons 只能用于API>=26。他提供了一个xml file res/mipmap-anydpi-v26/ic_launcher.xml
如果要用传统的方式只需按照以前的方法在 res/mipmap-density/ 的文件夹中添加 ic_launcher.png

这样manifest中的ic_launcher就有了不同的解读方法对于 API >=26 到 ic_launcher.xml取 其他的到mipmap中寻找需要分辨率的png


原文地址
https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
https://developer.android.com/studio/write/image-asset-studio

标签:icons,launcher,Image,API,Studio,device,adaptive,Android,icon
来源: https://blog.csdn.net/a66787237/article/details/117016690

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有