android - Set Vector Drawable in ImageView cause app crash in old SDK -


i used vector drawable in image src this:

 <imageview                 android:id="@+id/issold"                 android:layout_width="match_parent"                 android:layout_height="match_parent"                 android:layout_gravity="center_vertical"                 android:visibility="gone"                 app:srccompat="@drawable/ic_soldout_24px"                 tools:ignore="missingprefix"/> 

i added these manifest:

defaultconfig {         vectordrawables.usesupportlibrary=true     } 

and used compile 'com.android.support:appcompat-v7:23.2.1'

but app crashes in old sdk message of error inflating class imageview

use android.support.v7.widget.appcompatimageview instead of imageview:

 <android.support.v7.widget.appcompatimageview     android:id="@+id/issold"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:layout_gravity="center_vertical"     android:visibility="gone"     app:srccompat="@drawable/ic_soldout_24px"     tools:ignore="missingprefix"/> 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -