簡體   English   中英

Android 在 drawableStart 上無效的可繪制標記向量

[英]Android Invalid drawable tag vector on drawableStart

這是我的按鈕:

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

最后是錯誤:

Binary XML file line #1: invalid drawable tag vector

設置布局時會發生這種情況我該如何解決?

顯然, drawableStart不適用於 pre-lollipop 上的 Vectors; 這使我的應用程序崩潰。 刪除它是我的解決方案,也是唯一的解決方案,因為使用它們的唯一方法是使用app:srcCompatsetImageResource() ,這對drawableX不起作用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM