Android在drawableStart上无效的可绘制标记向量

时间:2016-10-16 15:23:25

标签: android vector android-drawable android-resources android-vectordrawable

这是我的按钮:

printMaze(originalMaze, width, height);

这是<com.rey.material.widget.Button android:id="@+id/joinOccasionBTN" style="@style/Material.Drawable.Ripple.Wave.Light" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:drawableStart="@drawable/ic_envelope" android:drawablePadding="2dp" android:gravity="center" android:onClick="goToOccasion" android:padding="20dp" android:text="@string/join" app:rd_enable="true" app:rd_rippleType="wave" />

ic_envelope

最后是错误:

<vector android:height="24dp" android:viewportHeight="58.0"
android:viewportWidth="58.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#E95853" android:pathData="M27.14,0.73L0,26v0.04h58v-0.04L30.86,0.73C29.81,-0.24 28.19,-0.24 27.14,0.73z"/>
<path android:fillColor="#C64645" android:pathData="M0,26.04h58v31.96h-58z"/>
<path android:fillColor="#D75A4A" android:pathData="M0.09,26.05l57.51,31.71c-0.03,0.13 -0.03,0.11 -0.06,0.24H0.13C0.06,58 0,57.94 0,57.87l0,-31.77C0,26.06 0.05,26.03 0.09,26.05z"/>
<path android:fillColor="#ED7161" android:pathData="M57.91,26.05L29,41.99l28.6,15.77c-0.03,0.13 -0.03,0.11 -0.06,0.24h0.33C57.94,58 58,57.94 58,57.87V26.1C58,26.06 57.95,26.03 57.91,26.05z"/>

在设置布局时会发生这种情况 我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

显然,app:srcCompat并不适用于前棒棒糖上的矢量;这使我的应用程序崩溃了。删除这是我和唯一解决方案的解决方案,因为使用它们的唯一方法是使用setImageResource()drawableX,这对{{1}不起作用}}