[英]Vector Drawable Not Overwritten by Build Variant Flavor Dimension
I have an app with a base brand and multiple whitelabel brands along with multiple server targets.我有一个带有基本品牌和多个白标品牌以及多个服务器目标的应用程序。 In my app's build.gradle,the flavors are defined as:
flavorDimensions("server", "whitelabel")
在我的应用程序的 build.gradle 中,口味定义为:
flavorDimensions("server", "whitelabel")
In my src/main/res/drawable
I have a logo.xml VectorDrawable for the base brand and it is overwritten in src/whitelabel1/res/drawable
.在我的
src/main/res/drawable
我有一个用于基本品牌的 logo.xml VectorDrawable ,它在src/whitelabel1/res/drawable
被覆盖。
When my app's build.config contains vectorDrawables.useSupportLibrary = true
the correct logo.xml is used in my ImageView.当我的应用程序的 build.config 包含
vectorDrawables.useSupportLibrary = true
,我的 ImageView 中会使用正确的 logo.xml。 If I remove useSupportLibrary
the ImageView renders logo.xml from main
even in the apk for Whitelabel1如果我删除
useSupportLibrary
,即使在 Whitelabel1 的 apk 中,ImageView 也会从main
呈现 logo.xml
<ImageView
android:id="@+id/imageLogo"
android:layout_width="@dimen/viewXS"
android:layout_height="wrap_content"
android:layout_margin="@dimen/marginXS"
android:adjustViewBounds="true"
android:padding="@dimen/marginXS"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_logo" />
It happened with me as well.它也发生在我身上。 only after writing this vectorDrawables.useSupportLibrary = true inside defaultconfig.
只有在 defaultconfig 中写入这个 vectorDrawables.useSupportLibrary = true 之后。 vector resources was picked from the flavor source set folder.
矢量资源是从风味源集文件夹中选取的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.