小编qwe*_*ewq的帖子

Xamarin - 检索项目的父项时出错:找不到与给定名称"Theme.AppCompat.Light.DarkActionBar"匹配的资源

我想使用Xamarin和Visual Studio使用Material Design创建一个应用程序.我想使用v7 AppCompat库来实现这一点,因此我的应用程序在旧设备上运行良好.

我按照本教程:

https://blog.xamarin.com/android-tips-hello-material-design-v7-appcompat/

并做了同样的事情.当我转到Main.axml文件(在Resources/layout文件夹中)时,有一个下拉菜单,您可以在其中选择主题(下图).但是,当我打开下拉菜单时,我的主题不会出现.所以我认为清理和重建我的项目是个好主意.但是当我清理项目时,我收到了这个错误:

Error retrieving parent for item: No resource found that matches the given
name 'Theme.AppCompat.Light.DarkActionBar'.

No resource found that matches the given name: attr 'colorAccent'.
No resource found that matches the given name: attr 'colorPrimary'.
No resource found that matches the given name: attr 'colorPrimaryDark'.
No resource found that matches the given name: attr 'windowActionBar'.
No resource found that matches the given name: attr 'windowNoTitle'.
Run Code Online (Sandbox Code Playgroud)

如何修复它并让我的主题出现在下拉菜单中?

编辑:

这是代码:

Main.axml

<?xml …
Run Code Online (Sandbox Code Playgroud)

c# xml android xamarin.android xamarin

5
推荐指数
1
解决办法
6678
查看次数

标签 统计

android ×1

c# ×1

xamarin ×1

xamarin.android ×1

xml ×1