- After discussing with the UI designer, divide the previous logo into two images, the foreground and the background.
- The previous logo is as follows:
- Now you need to separate the above image into foreground and background images as follows:
- Put the mouse focus on the src directory, press Windows: Ctrl+Shift+A or Mac: command+shft+A shortcut key, enter Image Asset. Open the Configure Image Asset window, as follows: When
configuring,Preview
there is a circle in it to indicate Scope, the main content of the logo is displayed within this scope, and the outside of the scope will be automatically cropped when it is displayed on the mobile phone.Preview
TheLegacy Icon
icon of the area represents the appearance of the startup icon on the 6.0 system. - All that is left is to confirm the creation of the startup icon, and
mipmap-anydpi-v26
you will see two xml files in the folder, as follows:
ic_launcher.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
ic_launcher_round.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
ic_launcher_background
And the ic_launcher_foreground
picture is generated by the second step configuration, and then the manifest file is also configured android:icon="@mipmap/ic_launcher"
, and it is successful here.
4. Question
android:roundIcon="@mipmap/ic_launcher_round"
: This is only available in the Android 7.1 system over version, don't care.- If you want to use the startup icon for other layouts, it is recommended to use it
@mipmap/ic_launcher
. It will present different styles according to different versions of the system. The effect is the styles previewed in the Configure Image Asset window. Some domestic machines are used in other layouts@mipmap/ic_launcher
even if the system is above 8.0. style or 6.0 system icons, but I use the phone abroad also tested, some foreign mobile phones likeSM-J330G
,HUAWEI ATU-L22
,OPPO CPH1803
these models can be done automatically adapted in other layouts.