Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 矢量图像的颜色选择器不';行不通_Android_Svg_Vector Graphics - Fatal编程技术网

Android 矢量图像的颜色选择器不';行不通

Android 矢量图像的颜色选择器不';行不通,android,svg,vector-graphics,Android,Svg,Vector Graphics,我有一个矢量图像(svg转换为xml): 但是颜色选择器不起作用。有可能实现我想做的吗?尝试对每个所需状态使用不同的VectorDrawable。什么是更好:viewportHeight=“24”更好:viewportHeight,更好:pathData等等,为什么要复制所有内容?用于在旧android版本上处理矢量图像的后端口库。我删除了所有的android:副本(如果您使用的是BatterVectorDrawable,那么为什么要使用“更差”),它可以正常工作感谢您的帮助,我会检查它。更

我有一个矢量图像(svg转换为xml):



但是颜色选择器不起作用。有可能实现我想做的吗?

尝试对每个所需状态使用不同的
VectorDrawable

什么是
更好:viewportHeight=“24”
<代码>更好:viewportHeight,
更好:pathData
等等,为什么要复制所有内容?用于在旧android版本上处理矢量图像的后端口库。我删除了所有的
android:
副本(如果您使用的是BatterVectorDrawable,那么为什么要使用“更差”),它可以正常工作感谢您的帮助,我会检查它。更新:哦,对不起,颜色选择器不起作用,我搞错了
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:better="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="NewApi"
    android:viewportWidth="24"
    better:viewportWidth="24"
    android:viewportHeight="24"
    better:viewportHeight="24"
    android:width="24dp"
    android:height="24dp">
    <path
        android:pathData="M10.09 15.59l1.41 1.41 5 -5 -5 -5 -1.41 1.41 2.58 2.59 -9.67 0 0 2 9.67 0 -2.58 2.59zM19 3L5 3C3.89 3 3 3.9 3 5l0 4 2 0 0 -4 14 0 0 14 -14 0 0 -4 -2 0 0 4c0 1.1 0.89 2 2 2l14 0c1.1 0 2 -0.9 2 -2L21 5C21 3.9 20.1 3 19 3Z"
        better:pathData="M10.09 15.59l1.41 1.41 5 -5 -5 -5 -1.41 1.41 2.58 2.59 -9.67 0 0 2 9.67 0 -2.58 2.59zM19 3L5 3C3.89 3 3 3.9 3 5l0 4 2 0 0 -4 14 0 0 14 -14 0 0 -4 -2 0 0 4c0 1.1 0.89 2 2 2l14 0c1.1 0 2 -0.9 2 -2L21 5C21 3.9 20.1 3 19 3Z"
        android:fillColor="@color/menu_color_selector"
        better:fillColor="@color/menu_color_selector" />
</vector>