在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
以上是内存溢出为你收集整理的关于Android Studio Image Asset 选项,设置app icon全部内容,希望文章能够帮你解决关于Android Studio Image Asset 选项,设置app icon所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)