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
Post a Comment