我是 xamarin android 的初学者,我尝试在 xamarin android 中开发一个简单的应用程序,它只使递减值为零......但是当我尝试递减值继续为负值时,我不能让它停在零值
如何使递减值停止在零?
enter code here public class MainActivity : AppCompatActivity
{
int txt3;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.activity_main);
TextView textView1 = FindViewById<TextView>(Resource.Id.textView1);
txt3 = 5;
textView1.Click += delegate
{
textView1.Text = (txt3--).ToString();
};
}
}
}
当我运行应用程序时,值为 5 4 3 2 1 0 -1 -2 -3 ...等