Csharp/C#教程:CS0117 C#’Resource.Id’不包含“PhoneNumberText”的定义分享


CS0117 C#’Resource.Id’不包含“PhoneNumberText”的定义

我使用Visual Studio 2015和Xamarin。 我正在命名我的项目“Phoneword”我在Xamarin的网站上看到了这个代码,例如tutorial / example。

TranslateButtonCallButton成员的错误相同。

MainActivity.cs

using System; using Android.App; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; namespace Phoneword { [Activity(Label = "Phoneword", MainLauncher = true)] public class MainActivity : Activity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Our code will go here // Get our UI controls from the loaded layout: EditText phoneNumberText = (EditText)FindViewById(Resource.Id.PhoneNumberText); Button translateButton = FindViewById

资源/布局/ Main.axml

     

我是Android开发的初学者 ,如果你需要其他信息,我会尝试添加更多细节。 请帮帮我

我解决了我的问题! 从我卸载的Tools / Android SDK Manager中:

我安装了:

在我关闭VS并重新启动它之后……在解决方案资源管理器中,我选择了“清洁解决方案”,然后选择了“重建解决方案”。

我的问题是,在我在项目中工作了一段时间之后,我更改了创建的默认名称空间。

如果您的值XML文件没有AndroidResource的构建操作(有时VS会将其创建为TransformFile),也会导致这种情况

我有同样的错误,但我的解决方案本身仍然会编译。

虽然错误列表中存在错误错误,但仍然很烦人。

试试这个:

通过这些步骤,我不再收到错误的错误。 我会建议那些有类似情况的人尝试这个。

上述就是C#学习教程:CS0117 C#’Resource.Id’不包含“PhoneNumberText”的定义分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/cdevelopment/954564.html

(2)
上一篇 2021年11月20日
下一篇 2021年11月20日

精彩推荐