【发布时间】:2017-02-23 10:05:02
【问题描述】:
我有一个带有 Minimum Android Version: 2.3 (API Level 10 - Gingerbread) 和 Compile Android Version: 6.0 (Marshmallow) 的 Android 应用程序 (Xamarin/Visual Studio)。
我尝试支持所有这些 Android 版本,同时保持我的应用的 Material Design 外观。
我尝试使用支持库(来自 NuGet:Xamarin.Android.Support.v7.AppCompat 版本 23 和 Xamarin.Android.Support.v7.CardView 版本 23),并将它们添加到我的项目中。
现在,我为 CardViews 创建了 3 个自定义样式;在我的 Resources/values/styles.xml 中,我有以下代码:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!--A single normal lesson for the Timegrid-->
<style name="Xamarin.Android.Support.v7.CardView.Lesson">
<item name="cardBackgroundColor">@color/orange_500</item>
<item name="cardCornerRadius">18dp</item>
</style>
<!--A single newly added lesson for the Timegrid-->
<style name="Xamarin.Android.Support.v7.CardView.LessonNew">
<item name="cardBackgroundColor">@color/green_500</item>
<item name="cardCornerRadius">18dp</item>
</style>
<!--A single cancelled lesson for the Timegrid-->
<style name="Xamarin.Android.Support.v7.CardView.LessonCancellation">
<item name="cardBackgroundColor">@color/grey_500</item>
<item name="cardCornerRadius">18dp</item>
</style>
</resources>
由于以下错误,我无法编译:
Severity Code Description Project File Line Suppression State Error Error retrieving parent for item: No resource found that matches the given name 'Xamarin.Android.Support.v7.CardView'.
我该如何解决这个问题? 提前致谢
【问题讨论】:
标签: android xamarin android-support-library