我在公共模块中有3个模块(公共模块、app1模块、app2模块)--我希望在app1中是黑色的,在app2中是白色的。
Layout.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 colors.xml
<ressources>
<color name="myColorBackground">#fff</color>
</resources>App2 colors.xml
<ressources>
<color name="myColorBackground">#000</color>
</resources>当我试图构建这个应用程序时,我就崩溃了。有办法用这样的颜色吗?
发布于 2019-12-06 14:37:20
通过在我的公共模块中添加<color name="myColorBackground"/>,我找到了一个解决办法,现在一切都正常工作了
发布于 2019-12-06 13:37:44
在使用模块时,您需要在每个样式中添加相同的文件,或者在主模块中使用公共文件,并在所需模块中覆盖特定的文件。

https://stackoverflow.com/questions/59212985
复制相似问题