I know this question is asking many time but i tried all of that but nothing meet my requirement i used android:drawableLeft
attribute in XML file for showing vector image in my button and its running on above API 21 but if i am running on same code in below API 21 like 19 then app got crashed, i am already add vectorDrawables.useSupportLibrary = true
, and AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
but both not work for me can any one help me out of this,my xml code is:
<android.support.v7.widget.AppCompatButton
android:id="@+id/shduleSms"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_shedule_sms"
android:drawablePadding="5dip"
app:layout_constraintTop_toBottomOf="@+id/textConCount"
android:padding="15dp"
android:layout_marginEnd="30dp"
android:layout_marginRight="30dp"
app:layout_constraintRight_toRightOf="@+id/textConCount"
android:layout_marginTop="15dp"
android:text="@string/sendlater"
android:textColor="@color/white"
android:theme="@style/MyButtonTwo"
/>
Please share your drawable code. There are some properties that cannot be used below SDK version 21 in vector drawable files and might lead to runtime crashes.
This error mostly occurrs due to a corrupt or unknown file. Please share your drawable source code if using an xml(vector).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.