xamarin.android - 错误 CS0117 Resource.Layout 不包含选项卡栏和工具栏 xamarin 的定义
问题描述
我使用将现有项目添加到我的项目中添加了另一个登录源代码项目,并且在清理解决方案和重建后出现此错误
我将 tabbar 重命名为 tabbar2 并将工具栏和 tabbar 从现有重命名为 toolbar1 和 tabbar1
解决方案
在我的情况下,为了解决这个问题,我不得不重命名:
layout/toolbar.xml
至
layout/Toolbar.xml
我从
android.support.v7.widget.Toolbar
至
androidx.appcompat.widget.Toolbar:
从:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
至
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
这导致编译时出现以下错误:
Error CS0117 'Resource.Layout' does not contain a definition for 'Toolbar'
从 toobar.xml 重命名为 Toolbar.xml 解决了这个问题。
推荐阅读
- ruby-on-rails - 如何在 Rails 中集成来自配置服务的配置文件?
- google-oauth - 谷歌语音到文本为客户端生成基于会话的身份验证令牌
- html - Sass 中的动态半文本颜色
- java - 如何使用共享首选项进行多重登录?
- python - Python 3.7 django 应用程序无法以未处理的异常启动
- ios - iOS在一个工作区中多个项目的优缺点是什么
- vue.js - Vue.js - 条件之间的转换(v-if 和 v-else)
- powershell - Why does the definition $id = 1 need?
- android - Android 操作栏选项菜单颜色更改
- django - Django - 定义多对多关系的最佳方式