CardView Design 不出现 Xamarin Android [英] CardView Design is not appear Xamarin Android
问题描述
我的 CardView 设计未正确显示在 Xamarin android 项目中.它给了我一个警报无法从 android 支持库加载控件".虽然我已经添加了所有支持库.我现在真的找不到丢失的库了.
My CardView design is not properly appearing in Xamarin android project. It's gives me a alert "could not load controls form the android support library". Though I've added all support libraries. I really can't find the missing libraries now.
我在 CardView 下有一个 imageview 和一些其他 textview,它们没有出现在设计中.但运行项目没有任何问题.
I've a imageview and some other textview under the CardView which is not appearing in design. but runs the project without having any issues.
非常感谢任何帮助.
[![这是我的设计预览.它只是显示文本 CardView][1]][1]
[![Here is my design preview. It's just showing the text CardView][1]][1]
这是图书馆
推荐答案
我认为您的项目可能已经迁移到 AndroidX.
I think your project may have migrated to AndroidX.
尝试安装 Xamarin.AndroidX.CardView
nuget 包并使用
Try to install Xamarin.AndroidX.CardView
nuget package and use
<androidx.cardview.widget.CardView>
...
</androidx.cardview.widget.CardView>
或安装 Xamarin.Google.Android.Material
nuget 包并使用
or install Xamarin.Google.Android.Material
nuget package and use
<com.google.android.material.card.MaterialCardView>
...
</com.google.android.material.card.MaterialCardView>
这篇关于CardView Design 不出现 Xamarin Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!