![](/img/trans.png)
[英]No resource found that matches the given name, where I do something wrong?
[英]No resource found that matches the given names
我将构建一个Xamarin应用程序但是当我开始构建Android项目时,编译器给出了9个错误:
9个错误:找不到与给定名称匹配的资源:
attr windowNoTitle
attr colorPrimaryDark
attr windowActionBar
attr windowActionModeOverlay
attr colorAccent
attr colorPrimary
attr colorAccent
Theme.AppCompat.Light.Dialog
Theme.AppCompat.Light.DarkActionBar
注意:错误发生在Project.Droid
项目的文件styles.xml
中。
在这里你可以找到styles.xml
文件:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">#2196F3</item>
<item name="colorPrimaryDark">#1976D2</item>
<item name="colorAccent">#FF4081</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">#FF4081</item>
</style>
</resources>
我在SmartBox.Droid
项目中没有任何改变,但是出现了这个错误。 问题是否发生是因为我在SmartBox (Portable)
项目中添加了MainPage.xaml
和Map.xaml
? 我需要两页,因为我将在两页之间导航。
我在谷歌和搜索引擎优化的各个地方都进行了搜索,但没有找到能帮助我的解 我可以在GitHub( https://github.com/HeinPauwelyn/SmartBox )的文件夹Execution→SmartBox中找到我的源代码
请试试这个解决方案:
将您的Xamarin更新到最新版本(共享项目和您的平台项目)。
然后重定向到C:\\Users\\<username>\\AppData\\Local\\
并将Xamarin
文件夹重命名为Xamarin_old
。
重新打开您的项目,然后构建它。 完全下载软件包需要几分钟。
尝试在Resources / Layout文件夹中的Tabbar.axml
和Toolbar.axml
编辑以下行。 这对我有用。
Tabbar.axml
从:
android:background="@style/colorPrimary"
app:tabIndicatorColor="@color/white"
至:
android:background="?attr/colorPrimary"
app:tabIndicatorColor="@android:color/white"
Toolbar.axml
从:
android:background="@style/colorPrimary"
至:
android:background="?attr/colorPrimary"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.