【发布时间】:2016-06-02 14:15:53
【问题描述】:
我正在使用一些来自 maven 的库,我已经在 gradle(Android Studio) 中有这个
dependencies {
//...other librarys
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:appcompat-v7:23.0.1'
}
我想将它用于兼容 VectorDrawable 作为旧 sdk 上 ImageView 的源代码 和背景。 但似乎没有任何效果。
在布局xml中:
xmlns:app="http://schemas.android.com/apk/res-auto"
和
<ImageView
android:id="@+id/svg_head"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/header"/>
这将是一个意外的命名空间前缀应用程序错误,如果我忽略(添加工具:忽略属性),则无法成功构建。
在java代码中:
我想为兼容的背景做这个 23.2.0 set vector drawable as background in 4.X
Drawable drawable = VectorDrawableCompat.create(getResources(), R.drawable.header, getTheme());
但是类
VectorDrawableCompat
和
AppcompatDrawableManager
找不到类(只显示红名,没有其他提示)
我用其他库很好,这是怎么回事???
【问题讨论】:
标签: android vector android-support-library