我最近开始使用 Xamarin 使用 C# 构建 Android 应用程序。我遇到的一个问题让我很难取得任何进展: 错误 CS0117
我有两个相同的项目,问题只出现在其中一个中。它最初发生在两者中,但重建几次修复了第一个。第二个似乎更持久。我真的需要找到解决这个问题的方法,因为引用是非常基本的和需要的。更不用说,它发生在每个新项目中。这是我的代码: NoteMath
using System;
using Android.App;
using Android.Content;
using Android.Widget;
using Android.OS;
namespace NoteMath_v1._0._1
{
[Activity(Label = "noteMath", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Window.RequestFeature(Android.Views.WindowFeatures.NoTitle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
EditText etInput = FindViewById<EditText>(Resource.Id.etInput);
TextView tvConsole = FindViewById<TextView>(Resource.Id.tvConsole);
etInput.KeyPress += (object sender, EditText.KeyEventArgs e) =>
{
e.Handled = false;
if (e.Event.Action == Android.Views.KeyEventActions.Down …Run Code Online (Sandbox Code Playgroud)