繁体   English   中英

Vector Drawable 不会被 Build Variant Flavor Dimension 覆盖

[英]Vector Drawable Not Overwritten by Build Variant Flavor Dimension

我有一个带有基本品牌和多个白标品牌以及多个服务器目标的应用程序。 在我的应用程序的 build.gradle 中,口味定义为: flavorDimensions("server", "whitelabel")

在我的src/main/res/drawable我有一个用于基本品牌的 logo.xml VectorDrawable ,它在src/whitelabel1/res/drawable被覆盖。

当我的应用程序的 build.config 包含vectorDrawables.useSupportLibrary = true ,我的 ImageView 中会使用正确的 logo.xml。 如果我删除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" />

它也发生在我身上。 只有在 defaultconfig 中写入这个 vectorDrawables.useSupportLibrary = true 之后。 矢量资源是从风味源集文件夹中选取的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM