Rebuild or regenerate 'ic_launcher.png' from images in Android Studio

前端 未结 15 865
清歌不尽
清歌不尽 2020-12-22 21:03

When one first creates a new project, that dialog lets you point to some external .PNG file, and then when that dialog completes, it generates 4 different pixel-sizes of ima

15条回答
  •  天涯浪人
    2020-12-22 21:33

    This is how I solved by creating an ic_launcher from a PNG image.

    1. I converted a PNG image into SVG image by using this website https://image.online-convert.com/convert-to-svg.

    2. I used the converted SVG image and converted it into a Vector Asset in Android Studio by, File > New > Vector Asset. This converted the SVG image into an XML file.

    3. I created the ic_launcher image by creating a new Image Asset in Android Studio by, File > New > Image Asset. This created an ic_launcher in a square, round and an Adaptive icon from the XML file.

    Note: At the time of writing I faced issues with the SVG image exported from Adobe XD. So I had to use the online converter. Adobe XD does not have xml export feature.

提交回复
热议问题