Search code examples
androidandroid-vectordrawable

Vector Drawables Android 23.3.0


I got '23.3.0' support library version, can when attempting to do this:

<android.support.v7.widget.Toolbar
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="@drawable/abc"
    app:layout_collapseMode="pin"/>

The drawable is not appearing in the device running api 21. As a matter of fact, my app has min Api 21, and even in the android studio preview, only N Preview Api 23 will actually draw the background. I have never had any problems with this with normal ImageViews. The vector is this one:

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="414dp"
        android:height="100dp"
        android:viewportWidth="414"
        android:viewportHeight="100">
    <path
        android:fillColor="#FFD50000"
        android:pathData="M 0,0 414,0 414,65 0,100 0,0"/>
</vector>

Any idea why it is not appearing?


Solution

  • You definitely should update your support library:

    Android Support Library 23.4.0 available now

    This release of the Android Support Library fixes a number of bugs in Support v4, AppCompat, Design, and Vector Drawable Compat. See the revisions page (https://developer.android.com/tools/support-library/index.html) for a full list of closed issues.

    https://plus.google.com/+AndroidDevelopers/posts/B7QhFkWZ6YX