在Flutter launch_background.xml中无法识别位图 [英] Bitmap not recognized in flutter launch_background.xml
问题描述
我想更改我的flutter项目的默认启动屏幕.因此,我首先在 launch_background.xml
中将颜色更改为 holo_orange_dark
.可以.
I want to change the default splash screen of my flutter project. So I've first changed the color to holo_orange_dark
in launch_background.xml
. It works.
现在,我要添加一个位图,如默认文件中的注释中所建议.我在app/src/main/res/drawable中放置了一个名为 splash.png
的文件,在所有mipmap ...文件夹中都放置了一个具有相同名称的文件,如屏幕截图所示:
Now, I want to add a bitmap, as suggested in a comment in the default file. I've placed a file named splash.png
in app/src/main/res/drawable and others with the same name in all mipmap... folders, as you can see in the screenshot:
我遇到错误无法解析符号'@ drawable/splash'
.我是否要在项目的其他地方声明此可绘制对象?(注意:我尝试引用 splash.png
-具有文件扩展名-具有相同的结果)
I've an error Cannot resolve symbol '@drawable/splash'
. Have I to declare this drawable in another place of my project ? (Note : I've tried to reference splash.png
- with file extension - with same result)
如果我运行我的项目,我将有一个与此无关的编译错误(inapp_webview上的渐变版本.如果删除了位图项,则奇怪的编译会消失)
If I run my project, I have an compile error that has nothing to do with that (gradle version on inapp_webview. If a remove the bitmap item, the strange compile disappear)
推荐答案
在编辑xml文件时,您应该在右上角看到此内容.单击打开以在android studio中进行编辑
You should see this at the top right when you're editing the xml file. Click open for editing in android studio
这篇关于在Flutter launch_background.xml中无法识别位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!