我正在开发一个Android应用程序,但我遇到了几乎完全相同的错误,就像这里所描述的一样:找不到与给定名称匹配的资源(在“colorAccent”处的值为“@Color/accent”)。
正如在此处(链接)描述的那样,我的项目中没有colors.xml文件。但是我在我的Android.sdk中找到了两个colors.xml文件。我应该使用其中之一吗?还是我必须创建一个新的colors.xml文件?如果我必须创建一个新文件,你能告诉我我需要写入文件的内容吗?
我是一个初学者,希望您能对我有一点理解。我使用带有Xamarin v4.1的Visual Studio。
我希望有人能帮助我 ;)
这是我的Strings.xml代码文件:
正如在此处(链接)描述的那样,我的项目中没有colors.xml文件。但是我在我的Android.sdk中找到了两个colors.xml文件。我应该使用其中之一吗?还是我必须创建一个新的colors.xml文件?如果我必须创建一个新文件,你能告诉我我需要写入文件的内容吗?
我是一个初学者,希望您能对我有一点理解。我使用带有Xamarin v4.1的Visual Studio。
我希望有人能帮助我 ;)
这是我的Strings.xml代码文件:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette-->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#00FFAA</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#004D40</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">@color/accent</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight and colorSwitchThumbNormal.
<item name="colorControlNormal">#00897B</item>
<item name="colorControlActivated">#1DE9B6</item>-->
<item name="windowActionModeOverlay">true</item>
</style>
</resources>
@color/colorName
进行访问。 - Malith Lakshan