0

我在我的应用程序中使用可绘制对象(从 SVG 导出)。

对于 android > 23 一切都很好,它们显示正确,但是在 android <= 23 中(特别是附加的图像来自 android sdk 版本 23),矢量变形,显示出drawables预览中没有出现的边缘。

可怕的边缘出现在两个drawable中

正如我之前所说,这发生在某些设备中,而不是在每个设备中,并且在 android <= 23 中。

我已经测试了一个谷歌材料设计图标 svg 并且在同一设备上完美运行,所以,这不能是 android 版本的错。

你有什么主意吗?

编辑:

这是Android Studio导出的drawable的代码:

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:pathData="M12,21a0.473,0.473 0,0 1,-0.336 -0.139l-7.95,-7.955a5.782,5.782 0,0 1,-1.25 -1.808,5.788 5.788,0 0,1 -0.459,-2.528c0.12,-2.92 2.398,-5.307 5.298,-5.551 1.722,-0.142 3.473,0.529 4.696,1.777 1.224,-1.248 2.976,-1.92 4.697,-1.777 2.9,0.244 5.179,2.63 5.299,5.551a5.788,5.788 0,0 1,-0.46 2.528,5.79 5.79,0 0,1 -1.248,1.808l-7.951,7.955a0.474,0.474 0,0 1,-0.337 0.139zM7.77,3.958A4.851,4.851 0,0 0,2.957 8.61c-0.03,0.734 0.099,1.444 0.382,2.111a4.827,4.827 0,0 0,1.046 1.506L12,19.845l7.616,-7.619a4.827,4.827 0,0 0,1.045 -1.506,4.839 4.839,0 0,0 0.383,-2.11 4.851,4.851 0,0 0,-4.426 -4.636c-1.572,-0.132 -3.18,0.555 -4.21,1.794 -0.169,0.275 -0.622,0.283 -0.802,0.016A5.026,5.026 0,0 0,7.77 3.958z"
        android:fillColor="#000"/>
</vector>

另一个可绘制对象:

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:pathData="M16.466,15.396a7.306,7.306 0,0 0,2.01 -5.02c0,-4.062 -3.354,-7.367 -7.476,-7.367s-7.476,3.305 -7.476,7.367A7.292,7.292 0,0 0,5.536 15.4L11,20.782l5.466,-5.386zM17.202,16.098l-5.84,5.754a0.517,0.517 0,0 1,-0.724 0l-5.837,-5.751a8.315,8.315 0,0 1,-1.567 -2.322,8.176 8.176,0 0,1 -0.734,-3.403C2.5,5.757 6.313,2 11,2c4.687,0 8.5,3.757 8.5,8.376a8.181,8.181 0,0 1,-0.735 3.405,8.332 8.332,0 0,1 -1.563,2.317zM11,7.054c1.858,0 3.37,1.49 3.37,3.322 0,1.831 -1.512,3.32 -3.37,3.32s-3.37,-1.49 -3.37,-3.32c0,-1.832 1.512,-3.322 3.37,-3.322zM11,8.063c-1.293,0 -2.347,1.038 -2.347,2.312 0,1.274 1.054,2.312 2.347,2.312s2.345,-1.037 2.345,-2.31c0,-1.275 -1.053,-2.314 -2.345,-2.314z"
        android:fillType="nonZero"
        android:fillColor="#000"/>
</vector>
4

0 回答 0