问题描述
我正在 Visual Studio 2015 中使用 Xamarin 创建新的 android 应用程序.我将组件 Android Support Design Library 23.4.0.1 添加到我的项目(组件)中在我的布局 (Main.axml) 中,我从入门 https://components.xamarin.com 复制并过去/gettingstarted/xamandroidsupportdesign但我收到错误未声明 android.support.design.widget.CoordinatorLayout
I'm creating new android application using Xamarin in Visual Studio 2015.I added the component Android Support Design Library 23.4.0.1 to my Projects (Components)In my layout (Main.axml) I copy and past from the Getting Started https://components.xamarin.com/gettingstarted/xamandroidsupportdesignBut I get error The android.support.design.widget.CoordinatorLayout is not declared
有什么想法吗?
Maxin.axml:
Maxin.axml:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
app:layout_scrollFlags="scroll|enterAlways">
<android.support.design.widget.TabLayout
app:layout_scrollFlags="scroll|enterAlways" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
推荐答案
尝试卸载支持库,然后重新安装.
Try uninstalling the Support Libraries and then reinstalling them again.
如果这不起作用,请尝试进入 C:\Users\{Your User}\AppData\Local\Xamarin
并删除其中的所有文件夹.然后在 Visual Studio 中进行清理和重建.
If that doesn't work, try going into C:\Users\{Your User}\AppData\Local\Xamarin
and delete all folders in there. Then do a Clean and Rebuild in Visual Studio.
这篇关于android.support.design.widget.CoordinatorLayout 未声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!