【发布时间】:2016-03-05 13:22:03
【问题描述】:
棒棒糖之前的设备现在可以通过支持库 23.2.0 使用 VectorDrawables 真是太好了。虽然我在 API 21+ 上有图像显示问题,但在较低的设备上一切正常。我使用的是 Gradle 插件 1.5,所以我的 build.gradle 包含以下内容:
// Gradle Plugin 1.5
android {
defaultConfig {
generatedDensities = []
}
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
然后我在布局中使用下一个代码:
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/my_vector_drawable" />
我已经在我父母的 ViewGroup 中声明了这个属性:
xmlns:app="http://schemas.android.com/apk/res-auto"
但 Android Studio 仍然显示此错误,但项目可以构建和运行
“为标签 ImageView 找到了意外的命名空间前缀“app””
这是新支持库的错误还是我做错了什么?
【问题讨论】:
标签: android android-imageview android-support-library android-vectordrawable