【发布时间】:2020-07-09 07:38:00
【问题描述】:
我正在尝试使用原生 android 创建启动画面,我正在使用颤振,我的 android 项目在 kotlin 中,我正在尝试为 android 创建新颜色,因为我需要特定的六色,但我无法创建自己的颜色,当我尝试时,颤动说无法识别颜色的名称。
这是一些尝试:
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<color name="goiaba">#e1635a</color>
</resources>
文件是android -> app -> res -> values -> styles.xml
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/black" />
<item android:drawable="@android:color/holo_blue_light">
</item>
</layer-list>
文件是android -> app -> res -> drawable -> launch_background.xml
当可绘制项目的颜色为 holo_blue_light 时,它可以正常工作,因为它已经是 android 颜色,但是当我尝试放置颜色“goiaba”时不起作用......
这是错误信息: android/app/src/main/res/drawable/launch_background.xml:13: AAPT: error: resource android:color/goiaba not found.
【问题讨论】: