将数字从 EditText 添加到 TextView
adding numbers from and EditText to and TextView
如何从 EditText 添加数字,然后在 TextView 中显示它们?
我试过转换它们但是没用...
total = FindViewById<TextView> (Resource.Id.textView14);
input1 = FindViewById<EditText> (Resource.Id.editText1);
input2 = FindViewById<EditText> (Resource.Id.editText2);
TextView total;
EditText input1, input2;
int totalScore;
totalScore = Convert.ToInt32(input1) + Convert.ToInt32(input2);
btnCalc.Click += (object sender, EventArgs e) => {
total.Text = Convert.ToString(totalScore);
};
感谢您的帮助..
btnCalc.Click += (object sender, EventArgs e) => {
totalScore = Convert.ToInt32(input1.Text) + Convert.ToInt32(input2.Text);
total.Text = totalScore.ToString();
};
如何从 EditText 添加数字,然后在 TextView 中显示它们?
我试过转换它们但是没用...
total = FindViewById<TextView> (Resource.Id.textView14);
input1 = FindViewById<EditText> (Resource.Id.editText1);
input2 = FindViewById<EditText> (Resource.Id.editText2);
TextView total;
EditText input1, input2;
int totalScore;
totalScore = Convert.ToInt32(input1) + Convert.ToInt32(input2);
btnCalc.Click += (object sender, EventArgs e) => {
total.Text = Convert.ToString(totalScore);
};
感谢您的帮助..
btnCalc.Click += (object sender, EventArgs e) => {
totalScore = Convert.ToInt32(input1.Text) + Convert.ToInt32(input2.Text);
total.Text = totalScore.ToString();
};