繁体   English   中英

svg图标无法在不同的屏幕尺寸或尺寸android中正确显示

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

在drawable文件夹中使用svg图标并在值hdpi,xdhpi,xxhpi,xxxhpi文件夹中创建dimen.xml文件,但svg图标在不同的维度设备中显示不同或svg图标获得有点不同的布局,如hdpi,xdhpi,xxhpi,xxxhpi。 那么这个问题是否有任何解决方案。

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

SVG内容

<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>

这是我们添加SVG时常见的错误

确保您正在检查覆盖,如图所示:

在此输入图像描述

希望这可以帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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