运行时变形的drawable

时间:2018-05-09 15:32:46

标签: android svg adobe-illustrator sketch-3

我在我的应用中使用drawables(从SVG导出)。

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

Horrible edges appear in both drawables

这在某些设备中发生,而不是在每个人中,并且在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>

0 个答案:

没有答案