C# Xamarin/Visual studio for Mac:axml文件未出现在intellisense类文件中,并在生成时引发错误
大家好,我正在用C在Visual studio for Mac/Xamarin上编写一个应用程序,我正在尝试将名为Dialog_SignUp的axml文件布局添加到我的类中以调用它,但我不理解为什么我的intellisense无法识别它,当我尝试构建它时,我有一个错误,即资源布局不包含Dialog_SignUp的定义CS0117 很明显,我的文件存在,它位于resource/layout/Dialog_SigbnUP.axml文件夹中,所以我在谷歌上做了一些研究,但我没有发现这方面的任何内容,或者我没有在谷歌上输入正确的关键字 希望有人能帮助我。谢谢 我的班级对话signup.cs: 我的类对话框\u SignUp.axml:C# Xamarin/Visual studio for Mac:axml文件未出现在intellisense类文件中,并在生成时引发错误,c#,android,xamarin.android,visual-studio-mac,C#,Android,Xamarin.android,Visual Studio Mac,大家好,我正在用C在Visual studio for Mac/Xamarin上编写一个应用程序,我正在尝试将名为Dialog_SignUp的axml文件布局添加到我的类中以调用它,但我不理解为什么我的intellisense无法识别它,当我尝试构建它时,我有一个错误,即资源布局不包含Dialog_SignUp的定义CS0117 很明显,我的文件存在,它位于resource/layout/Dialog_SigbnUP.axml文件夹中,所以我在谷歌上做了一些研究,但我没有发现这方面的任何内容,或
在you中,我会更改带有下划线的小写文件名,比如dialog_signup.axml。理论上,这两种约定都应该是正确的,但我总是用小写加下划线 其次,检查.csproj中是否包含文件。应该是这样的:
<AndroidResource Include="Resources\layout\dialog_signup.axml" />
也许您只需要重新构建Resource.designer.cs谢谢,回家后我会检查一下!但我很肯定你是对的。我没有想过重建资源。设计师!!!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#DEDEDC"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="300dp"
android:minHeight="400dp">
<EditText
android:id="@+id/txtFirstName"
android:layout_width="match_parent"
android:layout_height="35dp"
android:background="@drawable/edit_text_style"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="25dp"
android:hint="First Name"
android:paddingLeft="10dp"
android:textColor="#000" />
<EditText
android:layout_below="@id/txtFirstName"
android:inputType="textEmailAddress"
android:layout_width="match_parent"
android:layout_height="35dp"
android:id="@+id/txtEmail"
android:background="@drawable/edit_text_style"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:hint="Email"
android:paddingLeft="10dp"
android:textColor="#000" />
<EditText
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="35dp"
android:id="@+id/txtPassword"
android:background="@drawable/edit_text_style"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:hint="Password"
android:paddingLeft="10dp"
android:textColor="#000"
android:layout_below="@id/txtEmail" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/txtPassword"
android:layout_marginTop="50dp">
<Button
android:text="Sign Up!"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btnDialogEmail"
android:textSize="20dp"
android:textColor="#fff"
android:textStyle="bold"
android:paddingLeft="5dp"
android:paddingBottom="5dp"
android:paddingRight="5dp"
android:height="70dp"
android:paddingTop="2dp"
android:background="@drawable/ButtonSignUpStyle"
android:layout_centerHorizontal="true"
android:layout_marginLeft="30dp" />
</RelativeLayout>
</RelativeLayout>
<AndroidResource Include="Resources\layout\dialog_signup.axml" />
<AndroidResource Include="Resources\layout\dialog_signup.axml">
<SubType>Designer</SubType>
</AndroidResource>
public const int dialog_signup = [int];