简体   繁体   中英

svg icons are not showing properly in different screen sizes or dimention android

Using svg icon in drawable folder and creating dimen.xml files in values hdpi,xdhpi,xxhpi,xxxhpi folders but svg icons are showing differently in different dimension devices or svg icon getting a bit different layout like hdpi,xdhpi,xxhpi,xxxhpi. So is there any solution for this problem.

在此输入图像描述 在此输入图像描述

SVG content

<vector 
  android:height="24dp" 
  android:viewportHeight="96.0" 
  android:viewportWidth="96.0"
  android:width="24dp" 
  xmlns:android="schemas.android.com/apk/res/android">; 
        <path android:fillColor="#00000000" android:pathData="M32.74,87A23.74,23.74 0,1 0,9 63.26,23.74 23.74,0 0,0 32.74,87ZM63.26,87A23.74,23.74 0,1 0,39.52 63.26,23.74 23.74,0 0,0 63.26,87ZM48,56.48A23.74,23.74 0,1 0,24.26 32.74,23.74 23.74,0 0,0 48,56.48Z" 
        android:strokeColor="#141515" 
        android:strokeWidth="4"/> 
  </vector>

Well this is a common mistake when we add SVG

Make sure you are checking the Override as you can see in the image:

在此输入图像描述

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM