简体   繁体   English

Android版Mono:启动画面教程C#

[英]Mono for Android : Splash screen tutorial c#

I am brand new to android mono c# and am just following this Mono tutorial for creating a splash screen. 我是android mono c#的新手,并且仅遵循 Mono教程来创建初始屏幕。

I have started the tutorial several times from scratch but keep getting the same error when I try to run it through the emulator. 我已经从头开始了几次教程,但是当我尝试通过模拟器运行它时,仍然出现相同的错误。

C:\Documents and Settings\duncan\My Documents\MONO Android\HelloAndroid\HelloM4A\HelloM4A\HelloM4A\AndroidManifest.xml(0,0): 
Error 1: No resource found that matches the given name (at 'theme' with value '@style/Theme.Splash'). (1)

Can anybody shed any light on a possible cause for this???? 任何人都可以找到可能的原因吗????

The tutorial doesn't mention the Build Action, but the "AboutResources.txt" that I found in a tutorial solution has: 本教程没有提到Build Action,但是我在教程解决方案中找到的“ AboutResources.txt”具有:

In order to get the build system to recognize Android resources, set the build action to "AndroidResource" 为了使构建系统能够识别Android资源,请将构建操作设置为“ AndroidResource”

But even after verifying that I was still getting the same error. 但是即使在确认我仍然遇到相同的错误之后。

The gotcha I found was that the name has to be lowercase, and I suspect this is because the Android build uses resource tokens. 我发现的问题是名称必须是小写,这是因为Android版本使用资源令牌。 So you don't give the actual file name but the name that resolves to the token - which at least in my case was lower case such as "splash" vs "Splash" 因此,您不需要提供实际的文件名,而是解析为令牌的名称-至少在我看来是小写,例如“ splash” vs“ Splash”

Did you add Styles.xml file to the Resources/Values folder? 您是否将Styles.xml文件添加到Resources / Values文件夹中? Also, make sure that its Build Action is set to AndroidResource. 另外,请确保将其“构建操作”设置为AndroidResource。

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

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