Use of Android SVG

  • SVG : No need for resolution adaptation, infinite expansion without distortion, and much less space than PNG.
  • PNG : Suitable for icons, simple types, much better than JPG images.
  • JPG : Use images with complex colors, such as background images.

How to use SVG in AS (Ali’s iconfont)

  1. Open iconfont, select the icon color you need, and click SVG to download.
  2. Right-click your own Module in AS, New>Vector Asset, change Asset Type to Local File, Path is the SVG path you downloaded, and select Size.
  3. The system will generate the corresponding xml file under the drawable.
  4. Reference in the control, not directly in the class file.

Guess you like

Origin blog.csdn.net/xu331700/article/details/113064604