在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有两层,例如底层设置一层底色,上层设置一个图标,这样不同的设备可以根据需要裁剪成需要的形状不管是方形或是圆形,我们常