android - colors.xml 和多个模块
问题描述
我在公共模块中有 3 个模块(common、app1、app2) 我有一个布局,我想在 app1 中为黑色,在 app2 中为白色。
布局.xml
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="16dp"
android:background="@color/myColorBackground"
android:weightSum="4">
...
App1 颜色.xml
<ressources>
<color name="myColorBackground">#fff</color>
</resources>
App2 颜色.xml
<ressources>
<color name="myColorBackground">#000</color>
</resources>
当我尝试构建应用程序时,我遇到了崩溃。有没有使用这样的颜色的解决方案?
解决方案
我通过<color name="myColorBackground"/>
在我的公共模块中添加找到了一种解决方法,现在一切正常
推荐阅读
- c++ - Qt让ctor调用两次
- java - Spring boot Scheduler 不按照固定延迟随机执行
- iframe - 带有嵌套 I 帧的 Puppeteer-WaitForSelector()
- angular-material - How can I Integrate this code in .html file and .ts file?
- prolog - Prolog: How to convert hexadecimal value to integer in Prolog
- sql - 为什么我在更新级联上使用时出现错误?
- php - Is IonCube 7.2 backwards compatible with IonCube 5.6 PHP code?
- azure - 在使用 Azure 以太坊 PoA 解决方案模板设置的以太坊网络上获取初始以太币
- sql - 在 sql server 2008 中将列名和值转换为行名和行值
- javascript - Jquery: each button click, in the same class must to replace a content of div stored in vars depends on attr value